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-01-29T18:36:33+00:00

    This was very helpful. I didn't try it in sharepoint but I was able to use it in a shared network drive. However it didn't let me use the Excel share workbook function so only one person can edit at a time.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-10-28T16:33:14+00:00

    hi mate.

       can you please be more specific how can this be done? i mean step by step, what code needs to be written down and  so on.

       it would be very helpful to get the modified date for each sheet/tab, not only for the workbook.

    thanks in advance for your response.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-08-22T15:43:29+00:00

    Dear mlb70,

    Excel is part of the Office package, of which Word and PowerPoint are companions, and customers use the correct component for the task at hand.  One of the advantages of a package is that the components work similarly so that learning time is reduced, and the workers can produce documents that meet expectations of their bosses.  One expectation is knowing what date the document, spreadsheet, or presentation was updated, and as bosses tend to be, they want to know by glancing at the document, not by chasing down the worker.

    MY POINT is that was that component E doesn't work the same way as component W or P;  E is an exception, it is outnumbered.  Further, it has the ability surely within reach for normal, NON-MACRO, security-conscious users.

    This is not an argument of whether it CAN be done, it is an argument for making it EASILY done by those who use OFFICE.  Those who bury their head in Excel to the exclusion of fellow components, much less other offerings in the world, are doomed to fail.

    As much as Microsoft seems to pride itself on being all things to everybody, providing many ways to accomplish the same thing, in many languages and cultures, I find it interesting that there is so much resistance to this easy fix, which would provide the same feature customers can find when they look to the left (W) or right (P).  Perhaps Mr. Nadella hasn't shaken things up enough yet.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2015-08-20T12:55:17+00:00

    This was an Excel question, not Word. Good try though.

    Was this answer helpful?

    0 comments No comments