Putting the Last Saved Date in a Cell

Written by Allen Wyatt (last updated June 26, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


Kimberly wonders if there is a formula she can use to put into a cell the date the workbook was last saved. Even if she opens the workbook every day, she only wants the date updated every time she chooses to save.

There is no formula to do this; Excel doesn't have the native capability. You can, however, create a simple macro that will stick a date value into a cell whenever you save the workbook. This is based on the BeforeSave event, which belongs to the ThisWorkbook object:

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

    Sheets(1).Range("A1").Value = Now()
End Sub

This macro places the date (actually, the value returned by the Now function) into cell A1 of the first worksheet in the workbook. That cell should be formatted within Excel to whatever format you desire. There is a potential drawback to this macro—if you use Save As (to save the workbook under a different name) and then choose to cancel the save, the date is still updated because it took place before the save—meaning, it took place just as Excel was starting to save the workbook, not after the workbook was actually saved.

It should be noted that Excel also includes an AfterSave event which you may be tempted to use to update information. It, unfortunately, has a few loopholes, as well, and offers nothing more foolproof than the BeforeSave event does.

If you prefer, you can use a slightly different macro-based approach. This one relies on a regular macro, not an event handler:

Function LastModified() As Date
    LastModified = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function

Within whatever cell you want the date to appear, you would call the macro in this way:


The formula returns the date and time the workbook was last saved, and you can format it in any way desired. Since the function is noted as volatile, it is updated continuously, whenever the worksheet is recalculated.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13575) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Distributing Table Rows Evenly

If you've adjusted the height of your table and the rows within the table, you might want to later return all those rows ...

Discover More

Editing Word's Built-in Commands

Want to configure Word to do just what you want it to? You can even go so far as to change the actual way in which Word ...

Discover More

Turning Off Smart Quotes for Specific Styles

Smart quotes can be helpful in making a great-looking document, but at times they can be a real pain. Wouldn't it be ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Copying a Set Range from Multiple Worksheets to a New Worksheet

Want to create a summary worksheet that pulls a single row of data from each worksheet in the workbook? Here are a couple ...

Discover More

Determining the Hour of the Day

Need to know the current hour of the day? You can derive the information in your macros by using the Hour function, as ...

Discover More

Delimited Text-to-Columns in a Macro

The Text-to-Columns tool is an extremely powerful feature that allows you to divide data in a variety of ways. Excel even ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven minus 1?

2023-07-09 10:14:41

Willy Vanhaelen

Here is another approach. Insert the macro as descried in my comment of 6th June. Then insert the following UDF (User Defined Function) in a module:

Function SavedTime()
SavedTime = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function

Then enter =SavedTime() in cell A2.

When you open the workbook, A1 as well as A2 will display the same date+time namely the "Date modified" that is displayed in File Explorer. After a wile though when you progress with your work the time displayed in B2 will change. That will happen when Excel creates/updates an AutoRecovered file. That will also happen when you save your workbook without closing it.

That way you can monitor when the last AutoRecovered has been executed and if since then you did some important work save yourself the workbook by precaution.

2023-07-06 15:47:37

J. Woolley

Re. my previous comment below, My Excel Toolbox includes the following function to return the last save date/time for a file:
FilePath is optional; default is the active workbook. If FilePath is not absolute (like "C:\Users\MyName\Documents\MyFile.xlsx") or that file does not exist, then FilePath is assumed to be relative to the active workbook's folder (like "MyFile.xlsx" or ".\SubFolder\MyFile.xlsx"
or "..\SiblingFolder\MyFile.xlsx").
See https://sites.google.com/view/MyExcelToolbox

2023-07-06 15:20:29

J. Woolley

Here are three ways to get the active workbook's last modified (saved) date using functions available in My Excel Toolbox:
Notice "Last Save Time" is the 12th item in BuiltinDocumentProperties.
See https://sites.google.com/view/MyExcelToolbox
For more on this subject, see:

2023-07-06 08:30:24

Willy Vanhaelen

To avoid the SaveAs drawback of the first macro, you can use Excel's BuiltinDocumentProperties("Last Save Time") property by putting this macro in the ThisWorkbook code sheet:

Private Sub Workbook_Open()
Sheet(1).Range("A1") = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Sub

2023-07-06 00:32:57

Norm Thibodeau

Excel not providing a built-in LastSaved() date and time stamp function seems like a significant omission to me. This is a very commonly needed function for anyone why wants to tag the content in their file with this important info. As pointed out, Excel maintains save date as well as lots of other info in its file metadata. If we can write a function macro to pop this into a cell on a worksheet, then why can't Microsoft provide it as a built-in function so we could use it without having to make our workbooks macro enabled? The demand for this seems obvious to me just based on the returns when you do a Google search on it.
Two things are noteworthy.
1. I have seen many people who incorrectly use the =Today() function for the purpose of time stamping. But that simply displays the current system date each time the workbook is opened. That's useless as a time stamp. And misleading for any reader pf the file content.
2. MS Word DOES enable you to enter the Save date as text anywhere in your document (insert/quickparts/save date). Its ironic that a data centric app like Excel doesn't provide a quick way to insert this important element of data when Word, a mere word processor, does.

2020-05-13 13:15:43


Is there a way to return the last modified date of a different file by referencing a file path in the VBA code?

2020-01-14 11:49:02


Is this only for when the entire workbook was last modified? Is there a code for each individual worksheet tab?

2018-10-22 16:36:24

Alex B

I personally would prefer to see Date Last Modified in the spreadsheet rather than date last saved and by adding an if statement to the "Sub" in the tip, the date will only update if excel thinks you have made changes (which is not foolproof.)

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

    If Not ActiveWorkbook.Saved Then
        'This workbook contains previously unsaved changes
        Sheets(1).Range("A1").Value = Now()
   End If
End Sub

2018-10-22 16:07:27


There is another tip on Mr. Wyatt's site at this URL: https://excel.tips.net/T002285_Displaying_the_Last_Modified_Date.html .

It begins:

"If you look at the properties stored with a workbook, you will notice that Excel maintains quite a bit of information concerning the file. One of the items is a date and time that is simply noted as "Modified." Many people refer to this as the "last modified" date, but it really reflects the last time the workbook was saved."

and continues in telling you how to get the date which "really reflects the last time the workbook was save" and put it in a page header.

Seems one could do that, except put it in the desired cell rather than a page header.

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.