Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 281
Default Check for a tab if it is exist

Hi all,

i want to check in an Excel file for a tab name for example "AAA" and see if
this tab name is exist in the file or not everyone please help me.

Thanks,
--
Farhad Hodjat
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Check for a tab if it is exist

Something like this function should work...

Private Function SheetExists(sname) As Boolean
On Error Resume Next
IsError ActiveWorkbook.Sheets(sname)
SheetExists = Err.Number = 0
End Function

Just call it from your own code (macro, function, event procedure, etc.)
like this...

MsgBox SheetExists("AAA")

The function returns True if the sheet exists and False if it doesn't exist.

--
Rick (MVP - Excel)


"Farhad" wrote in message
...
Hi all,

i want to check in an Excel file for a tab name for example "AAA" and see
if
this tab name is exist in the file or not everyone please help me.

Thanks,
--
Farhad Hodjat


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
Exist or Not. ldiaz Excel Discussion (Misc queries) 3 September 6th 06 09:31 PM
Am I Looking For Something That Doesn't Exist? seanryann Excel Discussion (Misc queries) 11 April 1st 06 06:10 PM
Check if a value exist in a column DJ Steffo Excel Worksheet Functions 1 January 30th 06 02:37 PM
does a file exist Arien Excel Discussion (Misc queries) 3 January 3rd 06 01:27 PM
Does Worksheet Exist BillCPA Excel Discussion (Misc queries) 5 April 19th 05 11:22 PM


All times are GMT +1. The time now is 08:04 AM.

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

About Us

"It's about Microsoft Excel"