View Single Post
 
Old 11-02-2021, 08:43 AM
davidjm davidjm is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2018
Posts: 18
davidjm is on a distinguished road
Default

This took care of it:
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 = Chr(150) & "[0-9]{1,3}"
    Do While .Execute = True
         int1 = CInt(Replace(aRng.Text, Chr(150), ""))
        If int1 > 7 And int1 < 10 Then
            int1 = int1 - 8
        Else
            int1 = int1 + 2
        End If
      aRng.Text = Chr(150) & int1
      aRng.Collapse Direction:=wdCollapseEnd
      aRng.End = ActiveDocument.Range.End
    Loop
  End With
End Sub
One last question how would I combine these 2 sub()'s into 1, so that I process the index in 1 pass?

Thanks for all your help
Reply With Quote