Hi Dan,
I finished this off today on my lunch break. Lots of fun
Due to the different styles of file counters you'll need to add a few columns to your table which tells the code where to look for the counter (and if it is a date).
Additionally, the code ignores your "Transfer Required?" column since the formula used was unreliable, and by finding the difference between the file name counters we can infer whether a transfer is required or not.
The code works with all the file name styles in your sample workbook and works if there are gaps in the incrementation, e.g. if Data123.csv is the last import and Data130.csv is the latest source file, but only Data123.csv, Data125.csv, Data129.csv, and Data130.csv exist, it will import those files that exist and skip the gaps. This is more likely to happen with the date counters of course.
The code will print the transfer details to the console for information purposes. Example:
Find my code below. You will need the functions after the main sub, too. Also included at the end are the subs I used to create files / folders to test the code (NB that I set all file extensions to .txt for testing purposes).
Also attached is the workbook that I used to create / test this.
Enjoy!
Bookmarks