Index Worksheets

Denise

New Member
Joined
Feb 19, 2002
Messages
18
I'm trying to keep better documentation on some very large workbooks.

As part of this I'd like to create a template that includes a worksheet that lists every other worksheet in the workbook, or a macro that creates a new worksheet and lists every other worksheet in the workbook.

Is this possible?

Hope that made sense, and thanks for any help.

Denise
 
Hello lapta301

Try.

Code:
Private Sub Worksheet_Activate()
Dim wSheet As Worksheet
Dim l As Long
l = 1
Application.ScreenUpdating = False
    With Me
        .Columns.ClearContents
        .Cells(1, 1) = "INDEX"
        .Cells(1, 1).Name = "Index"
        .Cells(l, 2) = "DESCRIPTION"
        .Cells(l, 3) = "CODE NAME"
        .Cells(l, 4) = "INDEX NO: "
      For Each wSheet In Worksheets
          If wSheet.Name <> Me.Name Then
              l = l + 1
                  With wSheet
                    .Range("A1").Name = "Start_" & wSheet.Index
                    .Hyperlinks.Add Anchor:=.Range("A1"), Address:="", _
                      SubAddress:="Index", TextToDisplay:=.Range("A1").Text
                  End With
                  .Hyperlinks.Add Anchor:=Me.Cells(l, 1), Address:="", _
                    SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name
                  .Cells(l, 2) = wSheet.Range("B1")
                  .Cells(l, 3) = wSheet.CodeName
                  .Cells(l, 4) = wSheet.Index
                  .Columns.AutoFit
            End If
      Next wSheet
    End With
 Application.ScreenUpdating = True
End Sub
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Brian

Works a treat thank you so much.

Regards

Steve
 
Upvote 0

Forum statistics

Threads
1,215,753
Messages
6,126,677
Members
449,327
Latest member
John4520

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top