![]() |
#2
|
||||
|
||||
![]()
You can just use ReplaceAll. Also the direction doesn't matter when you are working on the whole range and wrapping.
Code:
Sub SingleBeforeDigit() 'Replace Chr(145) with Chr(146) before a digit (as in ’95) Dim oRng As Range Set oRng = ActiveDocument.Range With oRng.Find .ClearFormatting .Text = Chr(145) & "([0-9])" .Replacement.Text = Chr(146) & "\1" .Font.Superscript = False 'to avoid footnote reference marks .Replacement.Highlight = True .Wrap = wdFindContinue .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
lalywizz | Word | 5 | 10-08-2021 09:27 AM |
![]() |
arkansawyer16 | Excel | 10 | 04-06-2020 02:03 PM |
Regex/wildcard search for dates with 2-digit and 4-digit years | Marrick13 | Word VBA | 2 | 01-29-2016 07:04 AM |
![]() |
laucn | Excel Programming | 14 | 05-17-2015 12:12 PM |
![]() |
Natalie | Word | 2 | 04-26-2012 05:17 AM |