Excel Tip: Display Last Saved By Date & User

I found this handy tip to date stamp an MS Excel file's last-saved time (and person). (Yes, files do get time-stamped when saved, but if they are ever sent via email, that date-stamp can get over-written when saved off the server to a local hard drive. This little macro stamps the date right into the worksheet.)

Originally found here:

Here's how it's done: Right-click on worksheet tab, select "View Code". Copy and paste this code into the ThisWorkbook module (It features an Excel document icon on it.) It will automatically run when you save the file.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Sheets('Sheet1').Range('A1').Value = ThisWorkbook.BuiltinDocumentProperties('Last Save Time')

Sheets('Sheet1').Range('A2').Value = ThisWorkbook.BuiltinDocumentProperties('Author')

End Sub

Drop me a comment if you find this useful!


Brent said...

Very handy, indeed. Rather then doc poperty "Author", which is constant, the property "Last Author" returns the last person to have saved the document, which was more useful in my case.