Hello,
I have the following macro that saves the current excel file in a specific location, with todays date in the file name. Great. BUT, I'm trying to get it to save with yesterdays date.
I've tried assigning variables and the like, but no luck.
Can anyone else shed any light for me.
The code i am currently using is :-
Sub Save()
'
Dim strFileB
strFileB = Format$(Date, "yy-mm ")
Const sPATH As String = "c:\"
Const sFILE As String = "Fulfillment"
Const sVAR As String = ""
ActiveWorkbook.SaveCopyAs sPATH & strFileB & sVAR & _
Format(Now, "dd-mm-yy ") & sFILE & ".xls"
ActiveWorkbook.Close
End Sub
thanks in advance
I have the following macro that saves the current excel file in a specific location, with todays date in the file name. Great. BUT, I'm trying to get it to save with yesterdays date.
I've tried assigning variables and the like, but no luck.
Can anyone else shed any light for me.
The code i am currently using is :-
Sub Save()
'
Dim strFileB
strFileB = Format$(Date, "yy-mm ")
Const sPATH As String = "c:\"
Const sFILE As String = "Fulfillment"
Const sVAR As String = ""
ActiveWorkbook.SaveCopyAs sPATH & strFileB & sVAR & _
Format(Now, "dd-mm-yy ") & sFILE & ".xls"
ActiveWorkbook.Close
End Sub
thanks in advance