Hi there - I had https://www.mrexcel.com/forum/members/jmacleary.html kindly post some code a while ago.
Unfortunately the code intermittently stops working. Does anyone have any ideas why?
Basically the code is to update the date/time a particular range was last updated/changed.
Cheers, H.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
ActiveSheet.Unprotect
If Not Intersect(Target, Range("C5:E165")) Is Nothing Then
Range("B3") = "Last updated - " & Format(Now, "dddd dd/mm/yyyy") & " at " & Format(Time, "h:mmam/pm") & " by " & Application.UserName
End If
ActiveSheet.Protect
Application.EnableEvents = True
End Sub
Unfortunately the code intermittently stops working. Does anyone have any ideas why?
Basically the code is to update the date/time a particular range was last updated/changed.
Cheers, H.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
ActiveSheet.Unprotect
If Not Intersect(Target, Range("C5:E165")) Is Nothing Then
Range("B3") = "Last updated - " & Format(Now, "dddd dd/mm/yyyy") & " at " & Format(Time, "h:mmam/pm") & " by " & Application.UserName
End If
ActiveSheet.Protect
Application.EnableEvents = True
End Sub