In one of my previous blog posts, I demonstrated how to capture the name of a file using a formula. This week, I will demonstrate how to capture the date/time that the document was last Saved. This timestamp is the same as the one that exists in windows directory.
Go to “Developer” > “Visual Basic”, and paste the code below in the “ThisWorkbook” section. Change the M3 reference if you want the timestamp captured in another cell.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ActiveSheet.Range("M3").Value = Now
This macro will create a timestamp every time the document is saved so the user will know when the document was last updated upon opening the spreadsheet.