Workbook Latest Saved Time on Status Bar or in a cell

The following simple code allows you to see the workbook latest saved time on the status bar, every time when you would save the workbook.

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

‘Latest save time on status bar

Application.StatusBar = “Workbook Latest Saved Time:” & ” ” & Time

End Sub

Steps to understand this code:

First, open the visual basic editor window by clicking the ALT+11. Then right click on “ThisWorkbook” highlighted in the yellow color and click “View Code”. After this select the workbook circled in blue color as numbered 2 in picture. Then select the “BeforeSave” circled in blue color as numbered 3, Which is an event of workbook.


 

 

The First and last line will be entered automatically in result of following above steps.

Now write the 2 and 3 line code, circled in blue color. Which is as follow,

 

‘Latest save time on status bar

Application.StatusBar = “Workbook Latest Saved Time:” & ” ” & Time

 

 

 

Option: If you want to show time in a cell instead of status bar. Then you can replace the application.statusbar with Worksheets(“Sheet1”).Range(“A1”).value

Note: This technique is quite helpful if you are using excel as database, to track the latest time of workbook saved.

Practice File Download Link:  Workbook Latest Saved Time

Contact Us

Learn Excel Tricks
Email: info@learnexceltricks.com