Find and replace for comments in excel 2003

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

Guest

Hi ,
Actually i need the bulk updations in the comments in Excel 2003,
For eg.
In excel i have few cells in every cell i need to update specific word with
another word like find /replace.
please can you give me out needful information for my requirement.

Thanks,
omprakash
 
Dear Omprakash
you can use following macro
select the cells you want to make changes in comment & run this macro.
Please dont forget to experiment this with on small part of file or
backup copy.
i have written the code just now & tested it but not sure of any bug


Sub ReplaceinComment()
Dim temp1 As String, temp2 As String, temp3 As String, temp4 As String
ians1 = Application.InputBox("Find what", "Find & Replace for
comments", "")
ians2 = Application.InputBox("Replace with", "Find & replace for
comments", "")
temp3 = ians1
temp4 = ians2

For Each cell In Selection
temp1 = cell.Comment.Text
On Error Resume Next
temp2 = Replace(temp1, temp3, temp4)
cell.Comment.Text Text:=temp2
Next
End Sub

Regards
NC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top