D
Damien McBain
Hi,
I need to test for the existence of a worksheet with a given name.
Presently I'm using some code I found on the net like:
On Error Resume Next
Set xlobj = Workbooks(WorkBookName).Worksheets(SheetName)
If Err = 0 Then
do something
else
do another thing
End If
I find that this is an awkward way to perform the test because my
If..Then..Else is False no matter which error occurs.
Is there a more definitive way to perform the test?
TIA
I need to test for the existence of a worksheet with a given name.
Presently I'm using some code I found on the net like:
On Error Resume Next
Set xlobj = Workbooks(WorkBookName).Worksheets(SheetName)
If Err = 0 Then
do something
else
do another thing
End If
I find that this is an awkward way to perform the test because my
If..Then..Else is False no matter which error occurs.
Is there a more definitive way to perform the test?
TIA