Hello All
Seen below Code on the forum , works perfectly for workbook but looking something that can only copy and backup on tab
Is there a similar code that will create a backup in the same way, but designate that only one tab should be included in the newly created file? As i have many different tabs in the workbook which saving large file.
I put below under this workbook in VBA not sure how to make it work for Sheet 1 or Sheet 2..... only
thanks a lot
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim MyBackupPath As String
MyBackupPath = "G:\2022\Backup File\"
ActiveWorkbook.SaveCopyAs MyBackupPath & Format(Now, "yy.mm.dd h mm a/p") & " " & Application.UserName & " " & ActiveWorkbook.Name
End Sub
Seen below Code on the forum , works perfectly for workbook but looking something that can only copy and backup on tab
Is there a similar code that will create a backup in the same way, but designate that only one tab should be included in the newly created file? As i have many different tabs in the workbook which saving large file.
I put below under this workbook in VBA not sure how to make it work for Sheet 1 or Sheet 2..... only
thanks a lot
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim MyBackupPath As String
MyBackupPath = "G:\2022\Backup File\"
ActiveWorkbook.SaveCopyAs MyBackupPath & Format(Now, "yy.mm.dd h mm a/p") & " " & Application.UserName & " " & ActiveWorkbook.Name
End Sub