View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Find comment replace cell value

Something like this will do (Lightly tested)

Sub FindTextInComment()
Dim txtToFind As String
Dim cmt As Comment
Dim res As Double
txtToFind = InputBox("Enter text to find in comments")
For Each cmt In ActiveSheet.Comments
res = InStr(1, cmt.Text, txtToFind, 1)
If res 0 Then
cmt.Parent.Value = "123"
End If
Next cmt
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


wrote in message
oups.com...
Hi. I've searched through previous posts, and it seems that none is
what I am looking for. Everyone else seems to want to find cells with
specific text in the comment and replace that text within the comments.
What I need is to find all cells with specific text in the comments,
then replace the cell values. "Find all cells with "xxx" in the
comments and change all of the cell values to "123". I'd do it one by
one but there are hundreds. None of my macros seem to work. Any
ideas?

Thanks.
Kind regards,