Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default search for a sheet

How can I write a macro to search through a workbook to
determine whether a sheet with a specific name exist?
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default search for a sheet

And another take, .........

If WorksheetExists("YourSheetName") Then ' Do your thing.

Public Function WorksheetExists(WSName As String) As Boolean
'' Checks to see whether a WorkSheet exists.

On Error Resume Next
WorksheetExists = Len(Worksheets(WSName).Name) 0

End Function

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
On Fri, 12 Sep 2003 14:28:02 -0700, "Lee S." wrote:

How can I write a macro to search through a workbook to
determine whether a sheet with a specific name exist?
Thanks.


Reply
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
Search a name in one sheet and entry it into another sheet Shilpi Excel Worksheet Functions 4 May 5th 09 01:11 AM
search a value in W/sheet TUNGANA KURMA RAJU Excel Discussion (Misc queries) 7 April 4th 09 01:54 AM
Search for rows in one sheet and copy into another sheet based on customer id [email protected] Excel Worksheet Functions 1 October 22nd 07 03:09 AM
Can I search the whole workbook and not just a sheet? Kitty Excel Worksheet Functions 2 October 11th 05 04:02 PM
Search for a Sheet Chance224 Excel Discussion (Misc queries) 3 December 14th 04 12:29 AM


All times are GMT +1. The time now is 12:27 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"