Track tabs

N

Nico

I'm tracking applcations in a report I send to various managers. Each
application has its own tab (ex. ABC, CDE, EFG, HIJ), but not all tabs will
be present for each manager.

Manager A's workbook might have ABC, CDE, and Manager B's might only have HIJ.

I'd like to create an index tab that will lists all possible tabs and
indicate with a YES or NO whether or not the manager has that tab listed. Is
there a way to do this?

For example, Manager A's index would look like this:

ABC YES
CDE YES
EFG NO
HIJ NO

Manager B's index tab:

ABC NO
CDE NO
EFG NO
HIJ Yes

Thanks!
 
S

StumpedAgain

If I understand what you want, the following should do the trick:

Option Explicit
Sub index()

Dim indexselection As Range
Dim l, h, i As Long
Dim firstsheet As Worksheet

With Range("A1")
l = Range(.Offset(0, 0), .End(xlDown)).Rows.Count
End With

Set firstsheet = ActiveSheet
Set indexselection = Range("A1")

For h = 1 To l

For i = 1 To ActiveWorkbook.Sheets.Count
On Error Resume Next
If ActiveSheet.Name Like indexselection.Value Then
indexselection.Offset(0, 1).Value = "Yes"
Exit For
Else: indexselection.Offset(0, 1).Value = "No"
ActiveSheet.Next.Select
End If
Next i

firstsheet.Select
Set indexselection = indexselection.Offset(1, 0)

Next h


End Sub
 

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