View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
chijanzen chijanzen is offline
external usenet poster
 
Posts: 139
Default Finding a comment text

Hi Stefi:

Try

Dim comrng As Range, rng As Range
Set comrng = Cells.SpecialCells(xlCellTypeComments)
Const commtext = "???"
For Each rng In comrng
If rng.Comment.Text = commtext Then
MsgBox rng.Address(0, 0)
End If
Next

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Stefi" wrote:

Hi all,

Is there a better way to find a certain comment text (say in a variable
named commtext) within a range than checking each cell in the range with an
If Cell.Comment.Text = commtext then
statement in a For each ... cycle?

Thanks,
Stefi