If tab exists "Yes", else "No"

N

Nico

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!
 
R

ryguy7272

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---
 
N

Nico

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!
 
R

Rick Rothstein \(MVP - VB\)

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 said:
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 said:
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---
 
B

Bob Phillips

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 said:
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 said:
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---
 
G

Gary''s Student

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


Bob Phillips said:
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 said:
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 said:
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


:

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!
 
N

Nico

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

Bob Phillips said:
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 said:
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 said:
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


:

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top