Forum Discussion
awbenson
Jun 23, 2023Copper Contributor
Date of Last Modification of a Worksheet
Hello all, I have been trying to workshop a VBA code block with ChatGPT to display the date in a particular cell whenever ANY change is made in the worksheet. Here is my code so far: Private ...
JKPieterse
Jun 23, 2023Silver Contributor
I think this code does exactly the same as yours:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False ' Disable events to prevent recursive triggering
' Display the last modified date in the target cell
Range("B5").Value = Now
Application.EnableEvents = True ' Re-enable events
End Sub