Cells.Comment

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a macro, How to find out if a cell has a comment or not

Assume that A1 has a comment "Hi" and B1 has no comment text, I need the
condition (below) to check if the cell has a comment :-

If ( condition ) Then
'Msgbox comment.text
End if




TIA!
 
Try selecting a cell and then:

Sub is_it_there()
Dim r As Range
On Error Resume Next
Set r = ActiveSheet.UsedRange.SpecialCells(xlCellTypeComments)
If Not Intersect(r, Selection) Is Nothing Then
MsgBox ("comment found")
End If
End Sub
 
Back
Top