Not exactly sure how to build a loop into this macro.
I have a word document with many Table's and I need to look for an X in the table name and replace with sequential numerical numbers.
From
Table 3.X.
Table 3.X.
Table 3.X.
To
Table 3.1.
Table 3.2.
Table 3.3.
Until all Table's 3.X. are updated...
This macro will replace the first Table 3.X., but how to loop? Any thoughts?
Code:Sub EditFindLoopExample() Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "Table 3.X." .Replacement.Text = "Table 3.1." .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute With Selection If .Find.Forward = True Then .Collapse Direction:=wdCollapseStart Else .Collapse Direction:=wdCollapseEnd End If .Find.Execute Replace:=wdReplaceOne If .Find.Forward = True Then .Collapse Direction:=wdCollapseEnd Else .Collapse Direction:=wdCollapseStart End If .Find.Execute End With End Sub



