HI,
Is it possible to build a macro that saves a file and names it with the current day's (or month) date ? e.g. (March 08.xls, March 15, 2008.xls)
thank you
marius
HI,
Is it possible to build a macro that saves a file and names it with the current day's (or month) date ? e.g. (March 08.xls, March 15, 2008.xls)
thank you
marius
Hi,Originally Posted by mariusescu
Yes, just put the following code in the Workbook_BeforeSave event
![]()
ActiveWorkbook.SaveAs Filename:=Format(Date, "mmmm dd yyyy") & ".xls"
I got this macro from this forum sometime back. You can modify to what you want. This macro save the current active sheet into a separate workbook with the date in the filename.
![]()
Sub Save_Sheet_to_Individual_Workbook() ' ' Create individual workbook from active sheet Macro ' Dim Fname, strMessage As String ' 'Save active sheet as a workbook with today's date ' Fname = ActiveSheet.Name & "-" & Format(Date, "ddmmmyy") ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:=Fname & ".xls" ActiveWorkbook.Close SaveChanges:=False ' ' Display saved message strMessage = Fname & " saved in " & vbCrLf & vbCrLf & CurDir MsgBox strMessage, vbInformation, "File Saved!" ' End Sub
Thanks a lot guys. You're awesome. I really appreciate your help.
Have a great day
marius
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks