Hi,
Hoping someone could help, I could not find the answer using the search function.
I have found code that adds a comment to a cell, and adds the text from that cell into the comment, with time and date. If a comment already exists for that cell it adds the text to the bottom of the comment.
Which is the question, how do I make it so each time I run the macro it adds the cell text to the top of the comment.
This is the code I have at the moment.
Sub CommentDateTimeAdd()
'adds Excel comments with date and time,
' positions cursor at end of comment text
Dim strDate As String
Dim cmt As Comment
strDate = "dd-mmm-yy hh:mm"
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=Format(Now, strDate) & Chr(10) & ActiveCell.Value & Chr(10)
Else
cmt.Text Text:=cmt.Text & Chr(10) _
& Format(Now, strDate) & Chr(10) & ActiveCell.Value & Chr(10)
End If
With cmt.Shape.TextFrame
.Characters.Font.Bold = False
End With
End Sub
Thanks in advance,
Bookmarks