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
|