Some help with a last modified date/time problem

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
Hi all,

I'm very new to VBA and macros and am struggling to find a solution for what I would like to do.

I am using some code that i found to show the date and time that a worksheet was last modified in a given cell. This does not update on it's own. The only way that I am able to update the cell is to click into the formula bar after i have selected the cell and press enter.

I am hoping there is a way to automate it so the last modified date/time will always be up to date.

Can anyone help?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Right-click the sheet's tab and click View Code. Put this code in the right-hand pane:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    Range("A1").Value = Now
    Application.EnableEvents = True
End Sub
Format cell A1 with the required date-time format.
 
Upvote 0

Forum statistics

Threads
1,223,702
Messages
6,173,967
Members
452,539
Latest member
delvey

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