What if you work on the interface team and are responsible for managing thousands of text files. After threats of malware your company is looking push security but there is a catch you are now responsible for updating all these .txt files with a new of code. Where do you even begin? This is a time consuming task and accuracy is critical which is why we created the Excel Find and Replace across Multiple Text Files macro! This is an Excel macro that will Find and Replace values in Multiple Text Files. 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 Excel Workbooks you want to search through. If nothing is populated in the Column C this macro will loop through all of the Excel Workbooks available in the Active Excel Workbook’s Folder Path. Once a Excel Workbook 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 Text Files that are routinely changing information.
See it in Action
Watch this video to see this macro in action.
***Video coming soon!***
Code
Here 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 Office 16.0 Object Library, OLE Automation
Insider Content
Here 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 Text Files found within them. This varies from the Free Macro behavior in that Column C is used to loop through individual Text Files which can be labor some if you have 100s of files 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 Text Files to complete a Find and Replace. This macro will even loop through Sub-Folders within Sub-Folders. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object Library, Microsoft Office 16.0 Object Library, OLE Automation
The Developer Tab is an additional section of the ribbon when activated allows you access to Visual Basic in Applications like Access, Excel, Outlook, PowerPoint, Word.
Setup Now
Is focused on improving computer processes by Leveraging programming and applying Lean principles. It is our goal to make you more efficient and effective on your computer producing “Less Clicks and More Results!”
In regards to Word Create Outlook Email with Selected Text | VBA Macro #29
This is so perfect!
Thank you so much!
At my job, we recently switched over to Office 365.
Previously we had an email template that we could fill out (using field codes [select all+F9]) but that is no longer available in Office 365, as only Word has the Field Code capability now.
I was trying to find some sort of solution using Word, and yours was the best thing I could find on the web!
Very straightforward!
Very appreciated!
YOU are the awesome one!
In regards to Excel Find and Replace across Multiple Word Documents | VBA Macro #30 and custom work.
The use case for CheckTheBible.com was to convert all the variations of Bible verse codes (B C:V - Book Chapter:Verse) in any text to a standardized code. For example, "John 17:21" should be "Joh 17:21." Once the variations are converted, then the next step is to convert them to a markdown language so they can be used in Obsidian.
I found Brent through his YouTube channel: Leverage & Lean (https://www.youtube.com/LeverageLean). Out of all the macro videos, the "Excel Find and Replace across Multiple Word Documents" video seemed like it could help automate a seemingly manual process.
I contacted Brent to see what could be done with my use case. From our first discussion, Brent has always been very understanding and patient with my situation and listened to my suggestions for improving the macro’s speed and efficiency.
Once he understood the end goal, Brent took my improvements to heart and ran with them. Now with this improved macro, I can take on any set of variables, modify a few words, and convert them to the final result. This custom macro searches Word Documents for Bible verse codes, uses a standardized list of 30+ thousand B C:V codes to convert to the markdown language automatically with 100% accuracy.
I have had a great experience working with Brent. Not only does he clarify expectations so it was set up for success, but most importantly, he has always come up with creative and comprehensive suggestions even outside the scope of macro building. Brent was really consulting me to do more than what I had thought possible.