I have a multiple documents that I use a lot and often need to change specific names in the docs, the date and the name of the doc. To assist me with things that need to change, I use XXXXXXXX and ZZZZZZZZ as place holders in the docs. The file name also uses XXXXXXXX in the name to remind me to change it.
I copy the original of each doc and then change the name. I open each doc then use replace to change the XXXXXXXX and ZZZZZZZZ to the name I want and include match case. I would like to automate this process with VBA.
I assume it would work like this.
- I would put a copy of the original docs into a known folder.
- Running the code would open up a dialog box with text box to add the name to replace the XXXXXXXX in the file name and the XXXXXXXX and ZZZZZZZZ in the file text of the files.
- I assume it would be a process of looping through all the files in the folder and renaming them using the contents of the text boxes.
- Then opening each file and running a match case replace on the contents and then saving.
I'm at a loss as to how to start this. I understand basic loops in VBA for Excel and things like that, but this sort of manipulation I I'm not sure what to so. Does anyone have any pointers on how to approach this?
Bookmarks