WorkSheet Present

  • Thread starter Thread starter Dthmtlgod
  • Start date Start date
D

Dthmtlgod

Is there a way to check to see if a worksheet is present in a workbook?
 
Dim sh as Worksheet
On error resume next
set sh = Workbooks("BookA.xls").Worksheets("Sheet9")
On error goto 0
if sh is nothing then
msgbox "Sheet9 not in BookA.xls"
else
msgbox "Sheet9 was found in BookA.xls"
End If
 

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