Hey All,
A while back I used a vb I found here to lock cells that have been edited and it works great; I was wondering if there is anyway to add a comment with the date and time of the entry.
The code I use is below
Thanks for the help
A while back I used a vb I found here to lock cells that have been edited and it works great; I was wondering if there is anyway to add a comment with the date and time of the entry.
The code I use is below
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Answ As String
Application.ScreenUpdating = False
Answ = MsgBox("The cell will now be locked with your selection.", vbOKCancel, "Confirm Change")
If Answ <> vbOK Then
Application.EnableEvents = False
Target.ClearContents 'clear contents if cancel is pressed
Application.EnableEvents = True
Exit Sub
End If
ActiveSheet.Unprotect "1"
Target.Locked = True
ActiveSheet.Protect Password:="1", DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.ScreenUpdating = True
End Sub
Thanks for the help