How to Run Multiple Wildcard Replacements in Word with One Macro
Question details
The user wants to automate multiple wildcard text replacements in a specific sequence using a single VBA macro.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Performing several complex wildcard text replacements in a specific order, where doing it manually via the Find and Replace dialog is too time-consuming.
- Observed behavior
- The user seeks a one-click VBA solution to execute a predefined series of wildcard replacements automatically and sequentially.
Ensure the Developer tab is enabled in your Word ribbon and save a backup copy of your document before running bulk replacement macros to prevent accidental data loss.
Use a Master VBA Procedure to Call Multiple Replacement Macros
Create individual macros for each specific wildcard replacement, then build a master macro to execute them sequentially in a single click.
By breaking down each wildcard find-and-replace operation into its own sub-procedure, your code remains clean, easy to troubleshoot, and simple to update. A 'Main' procedure will then trigger each step in the exact order required.
Press Alt + F11 to open the Microsoft Visual Basic for Applications window, then click Insert > Module to create a new module space for your code.
Write a separate Sub procedure for your first replacement. Ensure you set .MatchWildcards = True and use .Execute Replace:=wdReplaceAll. Name it something like Sub Macro1().
If your replacement text requires special symbols like a star, use VBA's ChrW() function (e.g., ChrW(9733)) and concatenate it with your replacement string using the '&' operator.
Repeat the process for the rest of your text patterns, saving them as Sub Macro2(), Sub Macro3(), and so on, keeping the required chronological sequence in mind.
Write a final Sub MainMacro() that calls Macro1, Macro2, etc., in order. Close the VBA editor, press Alt + F8 in Word, select MainMacro, and click Run to perform all wildcard replacements instantly.

Automate Document Formatting with WPS Office Writer
If you work heavily with document formatting and complex text replacements, WPS Office Writer offers exceptional compatibility with Microsoft Word files (.docx) and supports advanced text manipulation features in a lightweight interface.
- 1. Download the software: Visit the official WPS website and download the free WPS Office installer.
- 2. Install WPS Office: Run the downloaded installation file and follow the brief on-screen instructions.
- 3. Open your documents: Launch WPS Writer to seamlessly open and edit your existing Word documents with full formatting preserved.

Frequently Asked Questions
How do I insert special Unicode characters like a star symbol in a VBA replacement?
You can use the ChrW() function in VBA alongside the character's decimal code. For example, ChrW(9733) inserts a solid star symbol into the replacement text string.
Why does my wildcard search macro not replace anything?
Ensure that the .MatchWildcards property of your Find object is set to True. Additionally, verify that your wildcard pattern syntax is strictly correct, as wildcards in Word/VBA behave differently than standard regular expressions.
Can I combine all replacements into one single macro procedure?
Yes, you can reuse the With oRng.Find block multiple times sequentially within a single Sub by updating the .Text and .Replacement.Text properties before each .Execute command. However, using separate macros makes troubleshooting much easier.




