Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then
Cancel = True
Application.EnableEvents = False
ActiveWorkbook.SaveAs Filename = Format(Now, "dd-mm-yyyy hh-mm-ss")
Application.EnableEvents = True
End If
End Sub
I don't think that is possible as a default. For an individual workbook you can use code like the following in the ThisWorkbook module
Code:Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Not SaveAsUI Then Cancel = True Application.EnableEvents = False ActiveWorkbook.SaveAs Filename = Format(Now, "dd-mm-yyyy hh-mm-ss") Application.EnableEvents = True End If End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then
Cancel = True
Application.EnableEvents = False
ActiveWorkbook.SaveAs Filename:=Format(Now, "dd-mm-yyyy hh-mm-ss")
Application.EnableEvents = True
End If
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
Application.EnableEvents = False
ActiveWorkbook.SaveAs Filename:=Format(Now, "dd-mm-yyyy hh-mm-ss")
Application.EnableEvents = True
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then
Cancel = True
Application.EnableEvents = False
ActiveWorkbook.SaveAs Filename:=Format(Now, "dd-mm-yyyy hh-mm-ss")
Application.EnableEvents = True
End If
End Sub