PDA

View Full Version : [SOLVED:] How to write a "replace" order in VBA working every other time



reza98
01-30-2023, 01:07 AM
I have a sort of long document with all parentheses toward one side; like (spring(, (fall(, (winter(.

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.

gmayor
01-30-2023, 03:41 AM
Answered at https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-write-a-replace-order-in-vba-working-every/cb92c14a-6876-4556-94ed-d7efb008a4df
Please cross post correctly!