Insert the date an Excel Workbook was last modified.

Anonymous
2010-11-17T00:13:29+00:00

Is there a way to insert, into a cell, the date that a workbook was last modified?

Perhaps by getting the modified date from the file's properties into a cell.

Thanks in advance.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-11-17T00:29:39+00:00

Hi,

To modify a workbook you have to save it so we can use the before_save event

ALY+F11 to open vb editor. Double click 'ThisWorkbook' and paste this code in on the right. Change the sheet and range to suit

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

Sheets("Sheet1").Range("A1").Value = Now

End Sub


If this post answers your question, please mark it as the Answer.

Mike H

Was this answer helpful?

100+ people found this answer helpful.
0 comments No comments

86 additional answers

Sort by: Newest
  1. Anonymous
    2014-09-12T18:59:00+00:00

    Where's "ALY+F11"?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-09-12T16:34:46+00:00

    Hi,

    To modify a workbook you have to save it so we can use the before_save event

    ALY+F11 to open vb editor. Double click 'ThisWorkbook' and paste this code in on the right. Change the sheet and range to suit

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

    Sheets("Sheet1").Range("A1").Value = Now

    End Sub


    If this post answers your question, please mark it as the Answer.

    Mike H

    This does not resolve the problem that Macros are perceived as Volatile and functions like SumProduct return invalid results with volatile components.  MS is still WAY BEHIND meeting users needs on this front.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-08-07T09:05:00+00:00

    Thanks, Dinesh, for the detailed instructions, but it did not work for me (using Excel 2010). I copied your code into the new "Module 1" under "Modules", saved the Excel file from within the VB window (I assume that is what you mean by "Save this file"?), then did "File, Close and Return to Microsoft Excel". When I start typing "= LastSaveDate" into a cell, the text populates automatically with the full LastSaveDate name (so it is present), but after I've hit Return the #NAME? error appears in the cell.

    Does anyone have any ideas where I'm going wrong?

    Just to agree with others, this is a very useful function that should be a standard function in Excel.

    Jon K

    Jon K - I too had the same issue - And realized it was because I had not enabled macros in the file. If you enable the macro - It works OK

    WK

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-07-02T14:08:30+00:00

    Worked perfect. Thanks.

    I also found the macros on the following website to be useful putting the Last Saved Date in the Footer or Header.

    http://excelribbon.tips.net/T007764_Displaying_the_Last_Modified_Date.html

    I'm not a MVP in Excel, but I was able to get this to work. I agree MS should simply have a button to insert this function into Headers and Footers, as this is a basic need for my Project Management Team.

    Was this answer helpful?

    0 comments No comments