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: Oldest
  1. Anonymous
    2014-09-13T18:53:35+00:00

    Chuck,

    Thanks for the greetings.  Glad to hear were both still around!

    And happy birthday to you on the 19th.

    '---

    Jim

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-10-01T18:45:51+00:00

    Pearson, do you know why it's showing me the result: 41,709.56 after I use this user-defined function? I have Excel 2013. Thank you.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-10-01T19:36:14+00:00

    That number is the serial number for the Date/Time

    You must now format as you wish.

    Gord

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-11-13T20:37:42+00:00

    I used Chips code and it worked just fine.

    Make sure to add a module.

    Insert the Function code in the module.

    Save your module > in 2010 you have to save as ".xlsm".

    Save the Spreadsheet.

    add the function call from a cell your working on.

    Make sure the cell is formatted to the date and time format you want displayed.

    I used custom( dd-mmm-yy hh:mm) this gives me up to the second the last time this document was saved.

    Was this answer helpful?

    0 comments No comments