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: Most helpful
  1. Anonymous
    2016-09-22T21:15:03+00:00

    You did exactly what I need. However, I'm a novice and I don't understand where to put the code. You say "copy the code into the right side." The right side of what? You then say "go back to your worksheet" Since you said that, I guess that the code must go somewhere else, not on the worksheet? Can you help?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-09-12T15:53:10+00:00

    Also you must remember to change the cell to format a date, otherwise if it is set to General, it will just read as the numerical formulation that MS assigns to all dates.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-09-10T03:42:47+00:00

    Ace,

    Are we aloud to email outside this forum? I would like to discuss specifics that I don't want the world to know.

    ******@yahoo.com

    This is an email I never use so if anyone else tries to spam me it won't matter.

    james

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-09-09T16:18:08+00:00

    Ace,

    Can I go one step further?

    In Excel options, it shows your username.

    Can I, in addition to showing the date, also show the username of the person making the change. Maybe in the next cell over? This way I can see who made the most recent updates to the spreadsheet as well.

    I guess the bottom line for me is to learn VB, right?

    Thanks for your help.

    James

    Was this answer helpful?

    0 comments No comments