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. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Anonymous
    2015-03-25T10:42:07+00:00

    I have followed that step by step and it still returns:

    #VALUE!

    and just for the record I have 'enable all macros' checked

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-03-21T15:40:19+00:00

    Many thanks I copied this code and it works well.

    Do you need to add the brackets to the Now function?

    =now()

    Many thanks

    Flora

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2015-03-10T15:25:17+00:00

    Thanks for you work on this question.

    The directions are easy to understand and I got the new function to work. However, when saving the VBA, you first need to save the workbook as a macro enabled one (.xlsm). I am using Excel 2013.

    Is there a way to get this function to work in a header or footer? So far I have not found a way.

    Was this answer helpful?

    0 comments No comments