how to check if Worksheets(x) exist?

  • Thread starter Thread starter NEED
  • Start date Start date
Hi
you may try something like
sub foo()
dim wks as worksheet
on error resume next
set wks = worksheets("your_name")
if err.number <>0 then
msgbox "worksheet does not exist"
else
msgbox "worksheet does exist"
end if
on error goto 0
end sub
 

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