![]() |
#2
|
||||
|
||||
![]()
With your example, which is not consistently formatted, e.g. Line 4 format has an extra space compared with Line 3, the following should do the job
Code:
Dim oRng As Range Dim i As Long Set oRng = ActiveDocument.Range i = 1 With oRng.Find Do While .Execute(FindText:="[0-9]{1,5},[ 0-9]{1,2},", MatchWildcards:=True) oRng.Text = "(" & Format(i, "000") & ") " & oRng.Text oRng.Collapse 0 i = i + 1 Loop End With
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Issue with wildcard search | mysterytramp | Word | 0 | 05-13-2015 10:40 AM |
search and replace a field containing text and numbers | H28Sailor | Word | 6 | 09-11-2014 01:00 AM |
Issue with Wildcard Search and Replace | linusthedog | Word | 3 | 09-04-2014 03:32 PM |
Where is the error in my wildcard search? | Ulodesk | Word | 10 | 06-30-2014 01:46 PM |
Wildcard search help. | Kempston | Word | 0 | 11-13-2009 03:58 AM |