functions to check it a worksheet exist in a workbook

  • Thread starter Thread starter Tang
  • Start date Start date
T

Tang

I would like to check if a worksheet exist using excel formula, is there one
like this:
=if (Sheets("ABC") exist, "yes", "no")

regards
 
Hi
one way:

public function sheet_exist(sname) as boolean
dim wks as worksheet
on error resume next
set wks = activeworkbook.worksheets(sname)
on error goto 0
sheet_exist = not wks is nothing
end function
 
Back
Top