How to check if a worksheet exists in worksheet collection

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

Guest

Hi All,
I wanted to know if there is any method to check if a worksheet exists in worksheets collection.I want to check this by worksheet name.

Thanks in advance

Regards
Raghu
 
See John Walkenbauch's function:

j-walk.com/ss/excel/tips/tip54.htm#func5

-----Original Message-----
Hi All,
I wanted to know if there is any method to check if a
worksheet exists in worksheets collection.I want to check
this by worksheet name.
 
Hi
one way

dim wks as worksheet
on error resume next
set wks = activeworkbook.worksheets("your_wks_name")
on error goto 0
if wks is nothing then
msgbox "worksheet does not exist"
end if


--
Regards
Frank Kabel
Frankfurt, Germany

Raghunandan said:
Hi All,
I wanted to know if there is any method to check if a worksheet
exists in worksheets collection.I want to check this by worksheet name.
 

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