skiping sections in a macro

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

Guest

I am wanting to run a macro to find a certain string of text and I want it to
delete that text if it finds it. Is there any way that I can set it up where
the macro will go to the next section if it does not find what it is looking
for instead of erroring out?
 
Yup, we can help you avoid the error... But post your code so we can see what
you are up to.
 
dim FoundCell as range

set foundcell = something.find(....)

if foundcell is nothing then
'do nothing
else
foundcell.entirerow.delete 'or whatever
end if

Notice that there won't be a .activate at the end of that .find(...) line.
 

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