LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can I programmatically check in Excel 2002 if a sheet exis

Works like a charm - thanks very much Bob!
-tom

"Bob Phillips" wrote:

Here is a function

'-----------------------------------------------------------------
Function SheetExists(Sh As String, _
Optional wb As Workbook) As Boolean
'-----------------------------------------------------------------
Dim oWs As Worksheet
If wb Is Nothing Then Set wb = ActiveWorkbook
On Error Resume Next
SheetExists = CBool(Not wb.Worksheets(Sh) Is Nothing)
On Error GoTo 0
End Function



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"RangerTom" wrote in message
...
from within the workbook, using VB, I need check all of the worksheet

names
to see if a name exists - listnames method(?) pastes them to a cell but I
need to check within the list to see if it exists. Thanks.




 
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
check if sheet exists mohavv Excel Discussion (Misc queries) 1 November 21st 07 01:58 AM
check if the sheet/tag exists Alex Excel Worksheet Functions 2 March 14th 06 08:58 PM
How to check from VBA if sheet exists? Alen Excel Programming 2 March 2nd 06 12:36 PM
Check to see if sheet exists Steph[_3_] Excel Programming 4 September 22nd 04 12:47 AM
check if sheet exists Ross[_6_] Excel Programming 3 July 25th 03 06:46 PM


All times are GMT +1. The time now is 08:11 PM.

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"