RWayneH
asked on
Does Sheet tab exist?
I am looking for some VBA that looks for a specific sheet tab name, and if it exists fine, if not create it. Has anyone done this before?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also iterate the worksheets, looking for a worksheet with a particular name.
Example:
Although I wrote it this article about Access objects, the basic principles apply for Excel:
https://www.experts-exchange.com/articles/6670/Object-Existence.html
Example:
Function WksExists(parmName As String) As Boolean
Dim wks As Worksheet
For Each wks In Worksheets
If wks.Name = parmName Then
WksExists = True
Exit Function
End If
Next
WksExists = False
End Function
Although I wrote it this article about Access objects, the basic principles apply for Excel:
https://www.experts-exchange.com/articles/6670/Object-Existence.html
ASKER
Yup worked fine. Thanks.
Open in new window