ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Track tabs (https://www.excelbanter.com/excel-programming/413864-track-tabs.html)

Nico

Track tabs
 
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!

StumpedAgain

Track tabs
 
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


--
-SA


"Nico" wrote:

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!



All times are GMT +1. The time now is 02:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com