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-03-17T22:08:41+00:00

    I use "Revised &[Date]" in the footer (w/o the quote marks). If I don't save after making changes (say to try something I end up not liking and in effect not changing the doc), then the date does not update but remains the same as when I opened the worksheet. So it is saving the date I revised it. I believe the formula also works in a cell, but I've never used it that way.

    Good Luck with your project! =D

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-03-01T00:05:00+00:00

    Another way would be to use a WorksheetChangeEvent macro to cause a DateTimeCode to be written to a hidden sheet to log a change to each sheet individually........knowing only if the workbook was changed is one thing, knowing which sheet was changed in even better.

    hth

    Vaya con Dios,

    Chuck, CABGx3

     

    Terrible answer. 

    You failed to answer the question that was posted! 

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

    You could say this queston is technically a yes/or/no question.

    But, I thinks its implied that how to do it is the request...

    not just saying  '...another way would be to....' and not say how use the macro you suggest.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-02-28T16:01:10+00:00

    what i did to put the date into a cell was use the NOW function.

    It puts the current date and time into the cell.

    =NOW()

    cell

    2/28/2014 10:55

            What i was looking for was a way to put the persons name on the sheet who last modified in the sheet itself since we share it

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-01-17T06:36:18+00:00

    Thank You Chip - This helped right away in first go ... Was quite simple I must say.

    Was this answer helpful?

    0 comments No comments