mole999
Well-known Member
- Joined
- Oct 23, 2004
- Messages
- 10,524
- Office Version
- 2019
- 2016
- 2013
- Platform
- Windows
I have looked at a number of methods to pull the Tab Names to an index sheet (skip over the code)
Each has its merits, yet I need to place an auto-updating (worksheet activate) starting in cell F6, and I have failed to find a way to place the start point, and I need to make these as hyperlinks, I'm expecting to get to at least three hundred sheets so its got to be reliable.
Its probably quite simple but I can't see a resolution
Code:
Private Sub Worksheet_Activate()
Dim wSheet As Worksheet
Dim l As Long
l = 1
With Me
.Columns(1).ClearContents
.cells(1, 1) = "INDEX"
.cells(1, 1).Name = "Index"
End With
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:="Back to Index"
End With
Me.Hyperlinks.Add Anchor:=Me.cells(l, 1), Address:="", _
SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name
End If
Next wSheet
End Sub
Sub Sheetnames()
Dim cells
Dim i
Columns(5).Insert
For i = 1 To Sheets.Count
cells(i, 1) = Sheets(i).Name
Next i
End Sub
Sub ListWorkSheetNames()
Dim Sheetnames
Sheetnames = Sheets.Count
Sheets.Add
ActiveSheet.Name = “SheetList”
Sheets(”SheetList”).Move after:=Sheets(Sheetnames + 1)
For i = 1 To Sheetnames
Range(”A” & i) = Sheets(i).Name
Next i
End Sub
Sub ListSheetNames()
Dim wSheet As Worksheet
Range("a:a").ClearContents
For Each wSheet In ThisWorkbook.Worksheets
If wSheet.Name <> "My_Sheet" Then cells(Rows.Count, "a").End(xlUp)(2).Value = wSheet.Name
Next wSheet
End Sub
Each has its merits, yet I need to place an auto-updating (worksheet activate) starting in cell F6, and I have failed to find a way to place the start point, and I need to make these as hyperlinks, I'm expecting to get to at least three hundred sheets so its got to be reliable.
Its probably quite simple but I can't see a resolution