Macro IntroSay a company rebranded and changed locations. How would you handle updating all the necessary internal documents with the new company name, address, phone number, and email address? This can be a massive undertaking for any company which is why we created the Excel Find and Replace across Multiple Word Documents macro! This is an Excel macro that will Find and Replace values in Multiple Word Documents. This macro references 3 columns in Excel. In Column A are the values to Find. In the adjacent cell in column B is the value that will Replace what is found. Column C is optional allowing you an opportunity to populate the full path to any Word Documents you want to search through. If nothing is populated in the Column C this macro will loop through all of the Word Documents available in the Active Excel Workbook’s Folder Path. Once a Word Document is opened this macro will loop through every Find and Replace value placed in Column A and Column B. This Excel macro is a great way to maintain Word Documents that are routinely changing information. After hearing your feedback there are now 2 different versions of the Excel Find and Replace across Multiple Word Documents macro! The first version will loop through the Word Document Content for text to Find and Replace. The second version will loop through the entire Word Document including the Header, Footer, Content and even TextBoxes looking for text to Find and Replace.
See it in ActionWatch this video to see this macro in action.
CodeHere is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object Library, Microsoft Word 16.0 Object Library, Microsoft Office 16.0 Object Library, OLE Automation
Insider ContentHere is the Insider code for this macro. This macro will allow you to use Column C to list multiple folder paths to loop through all of the Word Documents found within them. This varies from the Free Macro behavior in that Column C is used to loop through individual Word Documents which can be labor some if you have 100s of documents to loop through in a handful of Folders. Column C will remain optional and if nothing is populated in Column C this macro will look to the same Folder Path as the Active Excel Workbook, find the Sub-Folders, and loop through each one finding Word Documents to complete a Find and Replace. This macro will even loop through Sub-Folders within Sub-Folders. As mentioned above there are now 2 versions of the Find and Replace across Multiple Word Documents macro. This is also true in that we have an Insider version of this macro that will Find and Replace text across the Header, Footer, Content and TextBoxes while looping through all SubFolders for Word Documents that exist. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object Library, Microsoft Word 16.0 Object Library, Microsoft Office 16.0 Object Library, OLE Automation
CustomizationThese segments of code can be customized to personalize this macro.
Make these code lines no longer a comment to highlight the text you successfully replaced in the Word Documents you are searching
Remove if you don’t want a MsgBox when this macro finishes