stamp last time saved in a cell

duration17

New Member
Joined
Sep 26, 2006
Messages
9
Hello,

Is there a way to get in a cell the last time the file was saved?

Many thanks,
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Paste the following into This Workbook module:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A1") = Date
End Sub
 
Upvote 0
Hi
This should work

In the ThisWorkbook of the VBA Project
Change the general to workbook and then select the beforesave procedure. Copy in the sheets("sheet1")...... line below

Where "sheet1" is the name of your sheet and ("a1") is the cell you want to put the date in

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("sheet1").Range("a1").Value = Date
End Sub

If you are new to VBA then the following step by step should help

Select [Tools]
[Macro]
[Visual Basic Editor]
Double click on Thisworkbook (Bottom of VBA list of sheets)
On the right hand side window at the top you will see General
Click on the arrow next to it and select Workbook

Private sub workbook_open() will appear
On the top right side where the word open is click on the arrow
and moving up select before_save
and then copy in the line that save the date into the cell.

Every time the workbook is saved the date will appear in the cell

Trust this what you were after.
 
Upvote 0
Thank you very much for your answer and explanation, it is exactly what I am looking for! thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,252
Members
449,075
Latest member
staticfluids

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