2016-02-23

EXCEL/VBA - Verify the existence of a sheet


' 1. getSheetExistence
Public Function getSheetExistence(sheetName As String) As Boolean
On Error GoTo err

    ' If no error, then it exists
    If ThisWorkbook.Sheets(sheetName).Name <> "" Then
    End If
    getSheetExistence = True
    Exit Function
   
err:
    getSheetExistence = False
    Exit Function
End Function

No comments:

Post a Comment