I have a an extensive spreadsheet that is used for timing customers for billing time used. An occasional power problem has lost all data for that day. Used be multiple people, no one does an occasional Save manually.
Looking for an excel macro (or VBA code) to have workbook auto save every hour.
Collapse
X
-
Hi Charlie,
Interesting question. I found this on the MrExcel.com forum:
Copy this into any standard module:
Code:Option Explicit Public RunTime Sub StartTimer() RunTime = Now + #12:10:00 AM# Application.OnTime RunTime, "SaveBook", schedule:=True End Sub Sub SaveBook() ActiveWorkbook.Save StartTimer End Sub Sub StopTimer() On Error Resume Next Application.OnTime RunTime, "SaveBook", schedule:=False End Sub
Code:Private Sub Workbook_Open() StartTimer End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) StopTimer End Sub
Comment