check if a worksheet exist - VBA

  • Thread starter Thread starter Warren
  • Start date Start date
one way:

Dim wkSht As Worksheet
On Error Resume Next
Set wkSht = Worksheets("TargetSheet")
On Error GoTo 0
If Not wkSht Is Nothing Then
'worksheet exists
Else
'worksheet doesn't exist
End If
 
Back
Top