Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
d = Format(Now(), "yyyy-mm-dd_HH.mm.ss")
s = Left(ThisWorkbook.Name, InStrRev(ThisWorkbook.Name, ".") - 1)
ThisWorkbook.SaveCopyAs "E:\test\" & s & "_" & d & ".xlsm"
End Sub
原文:http://www.cnblogs.com/doctorsun/p/7684363.html