For just knowing that a cell contains a comment you may use:
Cells.SpecialCells(xlCellTypeComments).Activate
For returning the text in the comment - Thread68-519901 is good, indeed. I improved a little the solution making it to take in consideration the situation when the user has deleted the user name (like I almoust all the time do):
Function GetComment(ReferenceCell) As String
Dim cComment As Comment
Set cComment = ReferenceCell.Comment
If cComment Is Nothing Then
GetComment = "No comment"
Else
If Left(cComment.Text, Len(cComment.Author)) = cComment.Author Then
GetComment = Mid(cComment.Text, _
Len(cComment.Author) + 3, 999)
Else
GetComment = cComment.Text
End If
End If
Set cComment = Nothing End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.