Date Last Saved/Modified

animas

Active Member
Joined
Sep 28, 2009
Messages
396
I need a function to show date last saved or modified in a cell which will get updated each time workbook is saved/closed.

How can I do this?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You can add this capability to your workbook, it's not a built in function. Here's the UDF code for the new function:
Code:
Function LastSaved() As Date
    Application.Volatile
    LastSaved = ThisWorkbook.BuiltinDocumentProperties(12)
End Function

How to install the User Defined Function:

1. Open up your workbook
2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)
6. Save your sheet

The function is installed and ready to use.
=======

In a cell, enter this formula:

=LASTSAVED()

The cell will not return a value properly until the sheet has been saved. Format the cell to display the date/time to your liking.
 
Upvote 0
Thanks.

I put the formula in each sheet. But when I update a different sheet all worksheets cells with that formula is updated. It seems the function is updated at wrokbook level.
How can I keep updated values worksheetwise?
 
Upvote 0
This is completely different from your original question. If you're asking for a way to put a time stamp on each sheet individually any time there are any changes anywhere on each sheet, then that would require a worksheet_change macro.

For each sheet where you want this to occur:

1) Right-click the sheet tab
2) Select View Code from the context menu popup
3) Paste this code into the sheet module that appears:
Rich (BB code):
Private Sub Worksheet_Change(ByVal target As Range)
Application.EnableEvents = False
    
    Range("A1") = Now()

Application.EnableEvents = True
End Sub
4) Edit the highlighted code to the cell of your choosing
5) Close the editor
6) Format the cell to display the date/time stamp to your liking
7) Save your sheet
8) Repeat with other sheets.
 
Upvote 0
You can add this capability to your workbook, it's not a built in function. Here's the UDF code for the new function:
Code:
Function LastSaved() As Date
    Application.Volatile
    LastSaved = ThisWorkbook.BuiltinDocumentProperties(12)
End Function

How to install the User Defined Function:

1. Open up your workbook
2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)
6. Save your sheet

The function is installed and ready to use.
=======

In a cell, enter this formula:

=LASTSAVED()

The cell will not return a value properly until the sheet has been saved. Format the cell to display the date/time to your liking.

I've used your LastSaved() function with good success and wondered if you have a similar function to identify and record on the sheet the user name of the person performing the last save? Thanks!
Tom
 
Upvote 0
This will give you the last author:
Code:
Function LastAuthor() As String
    Application.Volatile
    LastAuthor = ThisWorkbook.BuiltinDocumentProperties("Last Author")
End Function


=LastAuthor()
 
Upvote 0
I knew there had to be an easy way to do this. I just put this simple function code to use. I can always rely on the gurus at MrExcel. Thanks!
 
Upvote 0
An interesting topic... Is there a way to record the last 3 saves of the workbook lets say in A1:A3 of Sheet1 please?
 
Upvote 0

Forum statistics

Threads
1,215,090
Messages
6,123,061
Members
449,091
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top