View Single Post
 
Old 08-23-2019, 10:32 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

You can have as many range variables as you want.

Dim oRng as Range
Dim oChar as Range
Dim oWord as Range
Dim oOpenRange As Range


If your insert this code in another macro then it should run the same as it did on its own:

Code:
Dim oRng As Range   Set oRng = ActiveDocument.Range   With oRng.Find     .Text = "([a-z])(/)([a-z])"     .MatchWildcards = True     .Replacement.Text = "\1 \2 \3"     .Execute Replace:=wdReplaceAll   End With
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote