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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,764
Paste the following into This Workbook module:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A1") = Date
End Sub
 

smi123

Board Regular
Joined
Nov 7, 2005
Messages
67
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.
 

duration17

New Member
Joined
Sep 26, 2006
Messages
9
Thank you very much for your answer and explanation, it is exactly what I am looking for! thanks again!
 

Forum statistics

Threads
1,136,517
Messages
5,676,314
Members
419,619
Latest member
jalme

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
Top