Insert a "Last update" cell into Excel

scarlett3

Board Regular
Joined
Jan 21, 2005
Messages
73
Office Version
  1. 365
Platform
  1. Windows
Hi,

How do I create an excel cell that displays the last time that the file was saved? I would like the results of the cell to read "Last update: ...." rather than just display the date/time.

Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi Glaswegian,

Thanks for the reply. That solution would create a cell value that reads: "21/01/2005 12:08" ...

But I would like to create a cell value that reads: "Last update: 21/01/2005 12:08" or whatever was the time of the last save.

Thanks.
 
Upvote 0
Just add 'Last Saved' to the code, like this
Code:
Sub LastSaveDetails()
ActiveSheet.Range("A1") = "Last Saved " & FileDateTime(ThisWorkbook.FullName)
End Sub
Does this help?
 
Upvote 0
Thanks again, Glaswegian.

I'm getting there, but now I can do it, I want to change it ;)

I've put the

ActiveSheet.Range("B2") = _
"Updated: " & FileDateTime(ActiveWorkbook.FullName)

bit in a macro so I can run it when I like rather than on save or close. But I would like this to be written to all selected worksheets (Sheet1, Sheet2, etc) rather than just the active one.

Can this be done?

Thanks.
 
Upvote 0
This code will put your saved details in each sheet except Sheet3 - which I've used to illustrate how to skip sheets.
Code:
Sub LastSaveDetails()
Dim sht As Worksheet

Application.ScreenUpdating = False
For Each sht In ThisWorkbook.Worksheets
    If sht.Name <> "Sheet3" Then
        sht.Activate
        Range("B2").Value = "Updated: " & FileDateTime(ThisWorkbook.FullName)
    End If
Next sht
Application.ScreenUpdating = True
End Sub
HTH

Regards
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,857
Members
449,051
Latest member
excelquestion515

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