Lydia90, the following code replaces all instances of the inputboxed string with sequential numbers starting from the number you choose (no need to change all xyz to XYZ).
Code:
Sub Uppercase_Stri()
'In slection, find all instances of the inputboxed string
'and replace them with sequential numbers.
Dim myRng As range
Dim stri As String
Dim i As String
Application.ScreenUpdating = False
Set myRng = selection.range
stri = InputBox("Enter the string to find")
i = InputBox("Enter the number to start counting from")
With myRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.text = stri
.Forward = True
.Wrap = wdFindStop
Do
If .Execute And myRng.InRange(selection.range) Then
i = i + 1
myRng = i
Else: Exit Do
End If
myRng.Collapse
Loop
End With
Application.ScreenUpdating = True
Set myRng = Nothing
End Sub