Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default If tab exists "Yes", else "No"

I have a number of tabs in a spreadsheet, I want a simple Yes/No index that
indicates whether or not a tab is present as some tabs will be present for
some managers, but not for others.

How do I do that?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default If tab exists "Yes", else "No"

Try something like this:
For Each sh In ActiveWorkbook.Worksheets
If (sh.Name) < "Password" Then
'do something here
End if
Next

Hope that helps ya,
Ryan---

--
RyGuy


"Nico" wrote:

I have a number of tabs in a spreadsheet, I want a simple Yes/No index that
indicates whether or not a tab is present as some tabs will be present for
some managers, but not for others.

How do I do that?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default If tab exists "Yes", else "No"

Sorry, perhaps I wasn't clear enough.

I need some sort of index to indicate which sheets are present.

For example, the workbook tabs would look like this:
[Index] [Program A] [Program C]

The [Index] tab would have a table indicating which sheets were present:

Program A Yes
Program B No
Program C Yes

Any ideas?

Thanks!

"ryguy7272" wrote:

Try something like this:
For Each sh In ActiveWorkbook.Worksheets
If (sh.Name) < "Password" Then
'do something here
End if
Next

Hope that helps ya,
Ryan---

--
RyGuy


"Nico" wrote:

I have a number of tabs in a spreadsheet, I want a simple Yes/No index that
indicates whether or not a tab is present as some tabs will be present for
some managers, but not for others.

How do I do that?

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If tab exists "Yes", else "No"

Maybe you could use this UDF (place the code in a Module)...

Function IsSheetNamePresent(SheetName As String) As String
On Error GoTo Done
IsSheetNamePresent = "No"
If Worksheets(SheetName).Visible Then IsSheetNamePresent = "Yes"
Done:
End Function

With your sheet names in Column A (starting in A1), put this in B1...

=IsSheetNamePresent(A1)

and copy down.

Rick


"Nico" wrote in message
...
Sorry, perhaps I wasn't clear enough.

I need some sort of index to indicate which sheets are present.

For example, the workbook tabs would look like this:
[Index] [Program A] [Program C]

The [Index] tab would have a table indicating which sheets were present:

Program A Yes
Program B No
Program C Yes

Any ideas?

Thanks!

"ryguy7272" wrote:

Try something like this:
For Each sh In ActiveWorkbook.Worksheets
If (sh.Name) < "Password" Then
'do something here
End if
Next

Hope that helps ya,
Ryan---

--
RyGuy


"Nico" wrote:

I have a number of tabs in a spreadsheet, I want a simple Yes/No index
that
indicates whether or not a tab is present as some tabs will be present
for
some managers, but not for others.

How do I do that?

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default If tab exists "Yes", else "No"

PUt the names in A1:An, and in B1 and copy down

=IF(ISERROR(INDIRECT("'"&A1&"'!A1")),"No","Yes")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Nico" wrote in message
...
Sorry, perhaps I wasn't clear enough.

I need some sort of index to indicate which sheets are present.

For example, the workbook tabs would look like this:
[Index] [Program A] [Program C]

The [Index] tab would have a table indicating which sheets were present:

Program A Yes
Program B No
Program C Yes

Any ideas?

Thanks!

"ryguy7272" wrote:

Try something like this:
For Each sh In ActiveWorkbook.Worksheets
If (sh.Name) < "Password" Then
'do something here
End if
Next

Hope that helps ya,
Ryan---

--
RyGuy


"Nico" wrote:

I have a number of tabs in a spreadsheet, I want a simple Yes/No index
that
indicates whether or not a tab is present as some tabs will be present
for
some managers, but not for others.

How do I do that?

Thanks!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default If tab exists "Yes", else "No"

very nice Bob
--
Gary''s Student - gsnu200795


"Bob Phillips" wrote:

PUt the names in A1:An, and in B1 and copy down

=IF(ISERROR(INDIRECT("'"&A1&"'!A1")),"No","Yes")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Nico" wrote in message
...
Sorry, perhaps I wasn't clear enough.

I need some sort of index to indicate which sheets are present.

For example, the workbook tabs would look like this:
[Index] [Program A] [Program C]

The [Index] tab would have a table indicating which sheets were present:

Program A Yes
Program B No
Program C Yes

Any ideas?

Thanks!

"ryguy7272" wrote:

Try something like this:
For Each sh In ActiveWorkbook.Worksheets
If (sh.Name) < "Password" Then
'do something here
End if
Next

Hope that helps ya,
Ryan---

--
RyGuy


"Nico" wrote:

I have a number of tabs in a spreadsheet, I want a simple Yes/No index
that
indicates whether or not a tab is present as some tabs will be present
for
some managers, but not for others.

How do I do that?

Thanks!




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default If tab exists "Yes", else "No"

That works perfectly, you're a genius. Thank you!!

"Bob Phillips" wrote:

PUt the names in A1:An, and in B1 and copy down

=IF(ISERROR(INDIRECT("'"&A1&"'!A1")),"No","Yes")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Nico" wrote in message
...
Sorry, perhaps I wasn't clear enough.

I need some sort of index to indicate which sheets are present.

For example, the workbook tabs would look like this:
[Index] [Program A] [Program C]

The [Index] tab would have a table indicating which sheets were present:

Program A Yes
Program B No
Program C Yes

Any ideas?

Thanks!

"ryguy7272" wrote:

Try something like this:
For Each sh In ActiveWorkbook.Worksheets
If (sh.Name) < "Password" Then
'do something here
End if
Next

Hope that helps ya,
Ryan---

--
RyGuy


"Nico" wrote:

I have a number of tabs in a spreadsheet, I want a simple Yes/No index
that
indicates whether or not a tab is present as some tabs will be present
for
some managers, but not for others.

How do I do that?

Thanks!




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default If tab exists "Yes", else "No"


"Gary''s Student" wrote in message
...
very nice Bob


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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM


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