All,
Apologies for the vague title - could not find a good way to word it. This thread plays off a recently posted one that a member was very quick to answer and get me on my way.
I have a file name of "May Scrap Net of Reserve with scrap codes.xls". My earlier post centered around how to automatically define "FileName" as the current month, solved in this manner:
Apologies for the vague title - could not find a good way to word it. This thread plays off a recently posted one that a member was very quick to answer and get me on my way.
I have a file name of "May Scrap Net of Reserve with scrap codes.xls". My earlier post centered around how to automatically define "FileName" as the current month, solved in this manner:
Code:
FileName = Format(Now(), "mmm ") & "Scrap Net of Reserve with scrap codes"
Windows(FileName).Activate
[CODE]
My question this go around is: The month portion of the file refernce will still be "May" for a the first trip through the daily update to the file, in early June. This will result in a Run Time Error if the user doesn't modify the code.
Is there a way to tell the program to, if the above code doesn't reference a valid file, to adjust the month backward one month?
Example:
It's Monday June 3rd 2013. That Monday I will need to run the scrap file for the month of May one more time (as I'm always capturing the previous workday's data), but the macro runs and doesn't find the "May" file, as the system clock/bios tells the program it's June.
Thanks to anyone who can point me in the right direction on this one!