Sub Main()
Dim bolSheetExists As Boolean
bolSheetExists = WorkSheetExists(”Sheet1″)
End Sub
Function WorkSheetExists(xlWkshtName As String) As Boolean
Dim xlWksht As Worksheet
WorkSheetExists = False
On Error Resume Next
Set xlWksht = Worksheets(xlWkshtName)
On Error GoTo 0
If Not xlWksht Is Nothing Then
WorkSheetExists = True
End If
End Function
Filed under: Worksheets
Trackback Uri

