Help with date

pedro-egoli

Well-known Member
Joined
Apr 25, 2004
Messages
1,217
Office Version
  1. 2016
Platform
  1. Windows
Have a spreadsheet with formula
Code:
=(TODAY())
and when I open spreadsheet the date shown is today's date.

What I would like is a formula that only changes the date if I make any changes and save those changes.

In other words if I did a sheet on 10th November and opened it on 18th November I want the date in cell with formula to show 10th November.
If on the 18th November, I then changed some figures and saved those changes I want the date to change to 18th November.

Thanks in advance
Pedro
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Press Alt-F11 to bring up VBA
Double-click on "ThisWorkbook" in the left pane
Paste this into the right pane:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
[a1] = Date
End Sub

Change [a1] to the cell you require.
 
Upvote 0
Thanks Tactps,
It worked so far as entering today's date, and I will try it again tomorrow.

If you don't hear further from me you will know it works.
Thanks
Pedro
 
Upvote 0
Trust me, it works.

Note that there is nothing to stop a user saving the file without making changes - the date will still get updated (as it is based on the save, not the change).
 
Upvote 0

Forum statistics

Threads
1,214,394
Messages
6,119,262
Members
448,880
Latest member
aveternik

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