mancubus
04-08-2014, 01:19 AM
hi. try this.
Sub FindandReplace()
Dim RNG As Range
Dim Tbl As Table
Dim j As Integer
Dim i As String
Dim k As String
Set Tbl = ActiveDocument.Tables(1)
With Tbl
For j = 2 To .Rows.Count
i = Left(.Cell(j, 1), Len(.Cell(j, 1).Range) - 1)
k = Left(.Cell(j, 2), Len(.Cell(j, 2).Range) - 1)
With ActiveDocument.Content.Find
.ClearFormatting
.Text = i
.Replacement.Text = k
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Next
End With
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.