Hi, waqarqrl,
whatīs wrong with the answer your received here? Please do not start a new thread but update information in that thread on whatīs working or what you are missing and explain what kind of trouble you ran into.
What kind of button: ActiveX or Formular? If Formular insert a standard module and copy this code there:
Sub waqarqrl_saveDate()
With ActiveWorkbook
.SaveCopyAs ActiveWorkbook.Path & Application.PathSeparator & Format(Date, "DDMMMYYYY") & ".xlsm"
End With
End Sub
Then insert the button via Developer Tab and assign the macro to it.
If ActiveX:
Insert the Button, double-click on the button and add the following code in between the lines of the procedure:
With ActiveWorkbook
.SaveCopyAs ActiveWorkbook.Path & Application.PathSeparator & Format(Date, "DDMMMYYYY") & ".xlsm"
End With
Please mind that you need to leave the Developer Mode to get the ActiveX-button to work.
The codes above will leave you in your original workbook and save a copy in the same folder with the Date requested (at least on my system with Excel2010 and xlsm as standard file format).
Ciao,
Holger
Bookmarks