Excel VBA Backup Workbook

Useful Macros - 9

Workbook Backup With VBA


         When the button is pressed, the workbook is copied to Documents folder . The copied backup workbook is named as "Backup mm-dd-yy hh-mm.xls".

 💡Our procedure:
Sub date_backup()
Dim zaman, isim As String
zaman = Application.Text(Now(), "mm-dd-yy hh-mm")
isim = "Backup" & zaman & ".XLS"
ActiveWorkbook.SaveCopyAs isim
End Sub


       We added a button to the page to run the backup macro, but if desired, the date_backup macro can be run from the Macro Window opened by pressing  Alt + F8  keys.


No comments:

Post a Comment