Sir Babydum GBE
09-06-2012, 08:49 AM
Hi
My Macro asks the user to locate 2 files in a specified folder before it interrogates them (the files, not the user).
I would like to streamline things a little and have the whole process automated.
The Files are in the Folder "D/Babydum" and there is a file containing today's orders titled thus: "Order DD-MM-YYYY-#####.xls"
I need the macro to look through the files in that folder and open the one that contains 26 characters (if you count the ".xls") AND where the first 16 characters contain the expression "Order DD-MM-YYYY" (Where the letters are replaced with the digits of today's date, of course).
IF it cannot find a match then the open dialogue box will appear allowing the user to search for it.
THe same for the second file except that it is simply looking for a file entitled "ABC DDMMYYYY.csv" (No hyphens separating the date digits)
Again, if not found then the user will get a chance to look for it himself.
Once the files are found then it gets on with its business, allowing the user time to make a coffee and eat a sandwich.
Many thx in advance
Sir BD
My Macro asks the user to locate 2 files in a specified folder before it interrogates them (the files, not the user).
I would like to streamline things a little and have the whole process automated.
The Files are in the Folder "D/Babydum" and there is a file containing today's orders titled thus: "Order DD-MM-YYYY-#####.xls"
I need the macro to look through the files in that folder and open the one that contains 26 characters (if you count the ".xls") AND where the first 16 characters contain the expression "Order DD-MM-YYYY" (Where the letters are replaced with the digits of today's date, of course).
IF it cannot find a match then the open dialogue box will appear allowing the user to search for it.
THe same for the second file except that it is simply looking for a file entitled "ABC DDMMYYYY.csv" (No hyphens separating the date digits)
Again, if not found then the user will get a chance to look for it himself.
Once the files are found then it gets on with its business, allowing the user time to make a coffee and eat a sandwich.
Many thx in advance
Sir BD