I'm trying to set a date variable (example 8/21/2016) so I can open a file using a date.
Every day I have folders named for the previous day so for example today I have a date labeled 8/24/2016 to pull and process some reports, I have the macros set up nicely but I have to change the following code in the macro to reflect the date:
Code
ActiveWorkbook.SaveAs Filename:="C:\Users\USERNAME\Desktop\8-24-2016 Out\FILENAME.xlsm" _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
What I'd like to be able to do instead of having to change both date sections is to have 1 section that I change and it impacts both dates for the open and save part of the macro. I've tried using:
Code
Dim dteProcess As Date
Set dteProcess = '8/24/2016'
Workbooks.Open Filename:="C:\Users\mearle\Desktop\(dteProcess)\act vs theo.xls"
With no avail, however this seems to be what google search is suggesting.
Can anyone point me in the correct direction on how to do this?