I have a macro that reads the files listed in a folder and sets a variable to the names. I only want to work with files that the name of the file contains _OCR. How can I filter my list of file names to show only those file names with _OCR included?
An example of a list of file names in a folder could be:
I am open to either filtering the list or learning how to set the initial variable of only files in a folder that contains _OCR in their name.
If I understood you correctly, here is a quick example to get you started:
I tested this but make sure you test this out some demo files first.
This just searches for the files containing _OCR and replaces it with the date- for demo purposes. Your area of focus is the If statement with the Variable contains _OCR portion. From there, you can do what you want.