LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Test for the existence of a worksheet?

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
--
Damien
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test for file existence Joseph[_46_] Excel Programming 1 November 12th 04 08:56 PM
Test for file existence Joseph[_45_] Excel Programming 1 November 12th 04 04:04 PM
Existence, Search, Test JohnNews Excel Programming 0 October 11th 04 05:48 PM
Test for existence of Name Jack Schitt Excel Programming 2 April 6th 04 06:51 PM
how do i test for the existence of a range name Jake Marx[_3_] Excel Programming 2 March 3rd 04 09:57 PM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"