Hi,
Apologies if the answer is somewhere already on here (being an amateur user of Excel, i'm bungling along and learning as I go!), I have the following code;
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address <> "$A$1" Then Exit Sub
If IsEmpty(Target) Then Exit Sub
Dim strNewText$, strCommentOld$, strCommentNew$
strNewText = .Text
If Not .Comment Is Nothing Then
strCommentOld = .Comment.Text & Chr(10) & Chr(10)
Else
strCommentOld = ""
End If
On Error Resume Next
.Comment.Delete
Err.Clear
.AddComment
.Comment.Visible = False
.Comment.Text Text:=strCommentOld & _
Format(VBA.Now, "MM/DD/YYYY at h:MM AM/PM") & Chr(10) & strNewText
.Comment.Shape.TextFrame.AutoSize = True
End With
End Sub
Now, the problem is that I wish to extend the code to work in multiple cells contained within one column i.e. say from H1 to H99, but for the life of me I cannot seem to work a way to achieve the result I desire - can doctor the code and make it work in every cell in every column, but this isn't ideal as I really want to limit the operation of the "comments/date and time/changes" limited to one column, multiple cell only!.
Many thanks for reading!
Bookmarks