Justincut
asked on
Add Previous Date to VBA Code
Hi Guys,
How do I add the Previous Business day to an Excel File name in a variable string?
eg. In this SelectMatchingWindow File name , I want it to pick up "YY.MM.DD - Daily GMSP Balance Sheet.xlsm"
Sub Macro6()
Filename = SelectMatchingWindow("- Daily GMSP Balance Sheet.xlsm")
'Sheets("EMEA").Select
'Windows("10.29.14 - Daily GMSP Balance Sheet.xlsm (sent).xlsx").Activate
Sheets("EMEA").Select
Range("A3:M63").Select
How do I add the Previous Business day to an Excel File name in a variable string?
eg. In this SelectMatchingWindow File name , I want it to pick up "YY.MM.DD - Daily GMSP Balance Sheet.xlsm"
Sub Macro6()
Filename = SelectMatchingWindow("- Daily GMSP Balance Sheet.xlsm")
'Sheets("EMEA").Select
'Windows("10.29.14 - Daily GMSP Balance Sheet.xlsm (sent).xlsx").Activate
Sheets("EMEA").Select
Range("A3:M63").Select
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can I suggest you don't use fullstops within the file name? Some virus checkers will take this file as having multiple file extensions so could include a virus.
Thanks
Rob H
Thanks
Rob H
Filename = SelectMatchingWindow(Forma