Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-30-2023, 12:14 AM
reza98 reza98 is offline How to write a "replace" order in VBA working every other time Windows 10 How to write a "replace" order in VBA working every other time Office 2019
Novice
How to write a "replace" order in VBA working every other time
 
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
 

Tags
if-statement, replace, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro Matt C Excel Programming 2 01-08-2022 06:03 AM
"Find and Replace" tool leaves out many of the occurrences of what I put in the "find" window Swarup Word 8 06-24-2021 08:31 PM
Find and Replace "^&" no longer working merryb Word 3 08-21-2018 04:01 AM
Replace "comma" with "and" in line of text audioman Word VBA 7 01-21-2016 03:11 PM
How to write a "replace" order in VBA working every other time Add a period of time to a referenced "Time" cell? derelyth Excel 4 03-27-2011 04:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft