Thanks very much, that worked a treat,
now I'm having problems with the second part
Code:
Sub FindTemplateToPage()
Dim aRng As Range, str As String, int1 As Integer, int2 As Integer, arrStr() As String
Set aRng = ActiveDocument.Range
With aRng.Find
.ClearFormatting
.MatchWildcards = True
.Text = "-[0-9]{1,3}"
Do While .Execute = True
int1 = CInt(Replace(aRng.Text, "-", ""))
If int1 > 7 And int1 < 10 Then
int1 = int1 - 8
Else
int1 = int1 + 2
End If
aRng.Text = "-" & int1
aRng.Collapse Direction:=wdCollapseEnd
aRng.End = ActiveDocument.Range.End
Loop
End With
End Sub
The code runs without error, but I think it's not finding
Code:
.Text = "-[0-9]{1,3}"
'cause
Code:
Do While .Execute = True
Jumps straight to end.
Any ideas?
Thanks