View Single Post
 
Old 01-30-2023, 12:14 AM
reza98 reza98 is offline Windows 10 Office 2019
Novice
 
Join Date: Jan 2023
Posts: 1
reza98 is on a distinguished road
Question How to write a "replace" order in VBA working every other time

I have a sort of long document with all parentheses toward one side; like (out of stock(.
Now I'm wondering how I can write a replace order replacing every other parenthesis.

I already know that the replace order is like:

Set myRange = ActiveDocument.Content
myRange.Find.Execute
FindText:="(", _ ReplaceWith:=")", Replace:=wdReplaceAll

but unfortunately, I don't know how to apply

If i Mod 2 = 0 Then

to the code above.
Reply With Quote