scotthannaford1973
Board Regular
- Joined
- Sep 27, 2017
- Messages
- 115
- Office Version
- 2010
- Platform
- Windows
Hi
I have the following code that saves an entire workbook to a specific folder and then adds the date and time to the file name. I am trying to amend it so that it only exports the current worksheet, saving it as .xlsx instead of .xlsm, not the entire worbook, but it does everything else that is shown. Would appreciate if someone can assist. TIA
Sub Auto_Save()
Dim savedate
savedate = Date
Dim savetime
savetime = Time
Dim formattime As String
formattime = Format(savetime, "hh.MM")
Dim formatdate As String
formatdate = Format(savedate, "YYYY.MM.DD")
Application.DisplayAlerts = False
Dim backupfolder As String
backupfolder = "M:\Acute\PMO\2018-19 CIP\0000. Archive\"
ActiveWorkbook.SaveCopyAs Filename:=backupfolder & formatdate & " " & formattime & " " & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
MsgBox "CIP Tracker backed up to " & backupfolder & " - check folder if needed!"
End Sub
I have the following code that saves an entire workbook to a specific folder and then adds the date and time to the file name. I am trying to amend it so that it only exports the current worksheet, saving it as .xlsx instead of .xlsm, not the entire worbook, but it does everything else that is shown. Would appreciate if someone can assist. TIA
Sub Auto_Save()
Dim savedate
savedate = Date
Dim savetime
savetime = Time
Dim formattime As String
formattime = Format(savetime, "hh.MM")
Dim formatdate As String
formatdate = Format(savedate, "YYYY.MM.DD")
Application.DisplayAlerts = False
Dim backupfolder As String
backupfolder = "M:\Acute\PMO\2018-19 CIP\0000. Archive\"
ActiveWorkbook.SaveCopyAs Filename:=backupfolder & formatdate & " " & formattime & " " & ActiveWorkbook.Name
ActiveWorkbook.Save
Application.DisplayAlerts = True
MsgBox "CIP Tracker backed up to " & backupfolder & " - check folder if needed!"
End Sub