VBA – Primjer 001

Posted: decembar 8, 2011 in Uncategorized
Oznake:,

Sub Del3Chars()
ActiveDocument.Tables(2).Cell(2, 2).Select
Dim TestText As String
Dim RestOfText As String
TestText = Selection.Text
Dim LSel As Integer
LSel = Len(Selection.Text)
Dim I As Integer
For I = LSel – 2 To 1 Step -1
If Mid(TestText, I, 1) = Chr(13) Then
TestText = Mid(TestText, I + 1, LSel – I – 2)
RestOfText = Left(Selection.Text, LSel – 2 – Len(TestText))
TestText = Replace(TestText, „xxx“, „“)
Selection.Text = RestOfText & TestText
Exit For
End If
Next
End Sub

Advertisements

Zatvoreno za komentare.