Macro to save file as date


Posted by Lewis on September 25, 2000 9:39 PM

Hi,
I'm trying to create a macro to automatically save my current file as a date however, I need the date to be one day ahead of the current date. So, if today is the 26th, I would like the macro to run saving the file as the 27th. The following formula is as close as I can find but, it will only save as "today", not "tomorrow".

Sub SaveAsTodaysDate()
Dim sFileName As String, sPath As String

sPath = "C:\" 'change path here
sFileName = Format(Now(), "ddmmmyy")
'File =sPath & sFileName Might fit in nice to do this way so you have a varialble to call the file
ActiveWorkbook.SaveAs (sPath & sFileName)
End Sub

Thanks for any help.
Lewis.

Posted by Celia on September 26, 2000 1:44 AM

Lewis
sFileName = Format(Now() + 1, "ddmmmyy")
Celia

Posted by David on September 26, 2000 1:44 AM

sFileName = Format(Now()+1, "ddmmmyy")
should work

Posted by David on September 26, 2000 2:01 AM


Jinx

Posted by Ivan Moala on September 26, 2000 2:52 AM

Lewis

Try changing your system formating
i.e the date format in your Control Panel
= Regional settings.


Ivan

Posted by Ivan Moala on September 26, 2000 2:54 AM

Wrong msg Posted

forget that post...wrong one



Posted by Lewis on September 26, 2000 9:27 PM

Thank you both.