View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
[email protected] magarians@yahoo.ca is offline
external usenet poster
 
Posts: 2
Default Find comment replace cell value

Actually, I just figured it out. If anyone is interested, my
successful macro is:

blic Sub findXYZ()

Dim myrange As Range
Dim rCell As Range
Const sStr As String = "XYZ"
Dim theCmt As Comment

Sheets("mysheet").Activate
Set myrange = Selection
For Each rCell In myrange
Set theCmt = rCell.Comment
If Not theCmt Is Nothing Then
If InStr(1, theCmt.Text, sStr, vbTextCompare) 0 Then
rCell.Value = 123
End If
End If
Next rCell


End Sub