Excel 2003 - VBA - Checking to see if a sheet is present

C

Craig Brandt

Hi,

What is a simple way to check to see if a sheet of a given name is present
in a workbook?

Thanks,
Craig
 
D

Dave Peterson

Dim Sht as object
set sht = nothing
on error resume next
set sht = activeworkbook.sheets("somesheetnamehere")
on error goto 0

if sht is nothing then
msgbox "nope"
else
msgbox "yep"
end if
 
Top