Hi, I have the following piece of code and I want to run it when a cell in a specified ranges is changed.
Private Sub worksheet_change(ByVal target As Range)
target.Interior.ColorIndex = 8
On Error Resume Next
Dim curcomment As String
curcomment = ""
curcomment = target.Comment.Text
If curcomment <> "" Then curcomment = curcomment & Chr(10)
target.AddComment
target.Comment.Text Text:=curcomment & ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & "Rev. " & Format(Date, "dd-mmm-yyyy") & Format(Time, "hh:mm")
End Sub
Thanks in advance.
Private Sub worksheet_change(ByVal target As Range)
target.Interior.ColorIndex = 8
On Error Resume Next
Dim curcomment As String
curcomment = ""
curcomment = target.Comment.Text
If curcomment <> "" Then curcomment = curcomment & Chr(10)
target.AddComment
target.Comment.Text Text:=curcomment & ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & "Rev. " & Format(Date, "dd-mmm-yyyy") & Format(Time, "hh:mm")
End Sub
Thanks in advance.