Question : excel vba test if worksheet exists
Answered by : vastemonde
Function WorksheetExists(pShtName As String, Optional pWb As Workbook) As Boolean Dim sht As Worksheet If pWb Is Nothing Then Set pWb = ThisWorkbook On Error Resume Next Set sht = pWb.Sheets(pShtName) On Error GoTo 0 WorksheetExists = Not sht Is Nothing
End Function
Source : https://stackoverflow.com/questions/6688131/test-or-check-if-sheet-exists | Last Update : Sun, 07 Feb 21