Is it possible to loop a find and replace array?
I have this find and replace array but I need it to loop until no more of the "find" statements are found. Is this even possible?
[CODE]'notready loop won't stop
SubFindReplaceMultiple()
'Do While??Until??
Application.ScreenUpdating= True 'False
Dim ArrFnd(), iAs Long
ArrFnd =Array("11", "1", “22”, “2”, "33", "3", “44”,"4", "55", "5")
IfUBound(ArrFnd) Mod 2 = 0 Then
MsgBox "Somethings Wrong Genious"
Exit Sub
End If
WithActiveDocument.range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
For i = 0 To UBound(ArrFnd) Step 2
.Text = ArrFnd(i)
.Replacement.Text = ArrFnd(i + 1)
'.Execute Replace:=wdFindContinue
.Execute Replace:=wdReplaceAll
Next
'End With
Application.ScreenUpdating= True
'Loop 'Until??
End With
End Sub
[/CODE]