Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

WorkSheetExists?

written by Mark Rowlinson - Last updated Sep 2005

Pass the workbook you wish to check for the sheet in and the sheet name. The function returns true or false to indicate if it was found.

 
Function SheetExists(wb As workbook,strname As String) As Boolean 
    On Error Resume Next 
    Dim ws As worksheet 
    Set ws=wb.sheets(strname) 
    SheetExists = Not ws Is Nothing 
End Function