It is even simpler:
Code:
Sub Repl_Stri_W_Sequential_Nums()
'In slection, replace all instances of the inputboxed string
'with captions.
Dim myRng As range
Dim stri As String
Application.ScreenUpdating = False
Set myRng = selection.range
stri = InputBox("Enter the string to find")
With myRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.text = "Figure " & stri
.Forward = True
.Wrap = wdFindStop
Do
If .Execute And myRng.InRange(selection.range) Then
myRng.Delete
myRng.InsertCaption label:="Figure", _
TitleAutoText:="", _
Title:="", _
Position:=wdCaptionPositionBelow, _
ExcludeLabel:=0
Else: Exit Do
End If
myRng.Collapse wdCollapseEnd
Loop
End With
Application.ScreenUpdating = True
Set myRng = Nothing
End Sub