find and replace

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

Guest

How do you change the 'find within' option in Find/Replace macro?

If you have selected 'within workbook' but want only search a selected set
of cells in a macro.
 
dim ran as range
set ran = Activesheet.range("A1:A10").find(what:="SearchData",Lookat:=xlwhole)
if not ran is nothing then
'data found
else
'data not found
end if

you can change range to what ever range you need
 

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