Hello,
Is it possible to have a macro save a workbook with the same name everyday but at the end of the name put the current date?
I would greatly appreciate any example code if someone knows. Thank you and best regards.
Printable View
Hello,
Is it possible to have a macro save a workbook with the same name everyday but at the end of the name put the current date?
I would greatly appreciate any example code if someone knows. Thank you and best regards.
I do not know about the Macro and Workbook, but in VB I use this code to append the current date to a folder name.
Result is c:\backups\travel\Data(10-27-00)Code:DestinationFolder = "c:\backups\travel\Data(" & Format(Now, "mm-dd-yy") & ")"
Hi,
Yes you can very well do that ....
Here is a sample.Have a look at it.
Code:
--------------------------------------------------------
sMonth = Format(Month(Date), "00")
sYear = Format(Year(Date), "0000")
sDay = Format(Day(Date), "00")
sFileName = "Whatever Name " & sYear & sMonth & sDay
xlApp.ActiveWorkbook.SaveAs "C:\" & sFileName
--------------------------------------------------------
In this way you can save with same name and with current date.
Hope this will help you
Good Luck