Answers for "xlvba function sheet exists"

VBA
25

xlvba function sheet exists

'VBA function to test if a sheet exists in the active workbook:

Function IsSheet(n$) As Boolean
    IsSheet = Not IsError(Evaluate(n & "!a1"))
End Function

'-----------------------------------------------------------------------

'Same thing, different technique (much faster):

Function IsSheet(n$) As Boolean
    On Error Resume Next
    IsSheet = Sheets(n).Index
End Function
Posted by: Guest on April-03-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language