![]() |
|
|
|
#1
|
|||
|
|||
|
Thanks Macropod! Your code fixed the infinite loop issue for that function and similar ones. The macro seems to run faster too.
However, I'm not sure how to convert other infinite-loop-prone functions that only replace parts of strings to your suggested format. For example: Code:
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[0-9]%-[0-9]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.MatchWholeWord = False
.Execute
End With
Do While oRng.Find.Found = True
oRng.Characters(2).Text = ""
oRng.Collapse Direction:=wdCollapseEnd
oRng.Find.Execute
Loop
Last edited by macropod; 04-06-2017 at 03:04 PM. Reason: Replaced quote tags around code with code tags |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Need Macro for Find and Replace, Inserting logo in Ms-Word.
|
Aswinraj | Word VBA | 1 | 06-05-2016 04:33 PM |
| Find and Replace Macro Need | djpemberton | Word VBA | 2 | 05-04-2016 07:53 PM |
Find and Replace Macro
|
amparete13 | PowerPoint | 3 | 03-11-2014 05:29 AM |
Word VBA Macro to Find and Replace based on the Alt Text of an Image
|
bennymc | Word VBA | 1 | 01-27-2014 04:23 PM |
| Find and Replace Macro - A Better Way | Tribos | Word VBA | 0 | 10-08-2008 03:22 AM |