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
    2016-08-10T22:27:16+00:00

    Thank you, but this doesn't do what I need it to do. I have multiple sheets in a workbook showing different business accounts on each sheet. I need to know when each account was updated when a payment was made. With entering the now () formula on each sheet, when I update one sheet all of the formulas change at the same time showing that each of the accounts was updated when just one of them was actually updated. The now () formula is a workbook formula, not a worksheet unique formula. Any ideas?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-08-10T22:02:50+00:00

    Easy peasy, but should be built in.

    In the area your want the Date Modified to be, type a cell with the label 

    Date Modified. To the right of that cell type   =NOW()  

    Every time the sheet recalculates, a timestamp will be calculated in that cell.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-07-14T06:41:37+00:00

    Hi, is there a solution that will enable to track the date of the external file, ie: placed in the same folder ?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-06-07T16:33:04+00:00

    I used this VB code and found useful.

    Let me explain step by step. May be this is useful for others.

    1. open up your work sheet.
    2. Press Alt + F11. You will find a Visual Basic scree opening up.
    3. Go to 'Insert' menu and select 'Module'. you will find a screen opening up
    4. Copy the below code and paste in the window.

    Function LastSaveDate()

    Application.Volatile True

    LastSaveDate = FileDateTime(ThisWorkbook.FullName)

    End Function

    1. Save this file and close the VB window.
    2. in the cell where you want to insert the last saved date type

       = LastSaveDate()

    and save the exel file.

    It works right without any problem.

    Dinesh:  I applaud you!  Thank you... that was excellent step-by-step instructions, and exactly what I (and I suspect many people) needed!

    The only thing I would add is a reminder to format the cell:

    7.   Right click on the cell where you typed '=LastSaveDate()'

    8.   Left click on "Format Cells..."

    9.   Select the "Number" tab

    1. Select the appropriate format for your needs.  Because my document could be saved multiple times in one day, I opted to display the date and time.

    I also added an indicator to the left of the '=LastSaveDate()' to identify what the date represents... now my document displays the following:

    Last Saved:  6/7/16 12:13 PM

    Was this answer helpful?

    0 comments No comments