Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub TOC()
Dim ws As Worksheet
'Check each worksheet name to see if it is "TOC".
'If not, then create a new worksheet named "TOC"
'and place at the beginning of the workbook.
For Each ws In Worksheets
If ws.Name = "TOC" Then
GoTo Line1
End If
Next
With Worksheets.Add
.Name = "TOC"
.Move before:=Worksheets(1)
End With
'On worksheet named "TOC", first go to cell A3 and
'clear all cells to the end, then beginning at cell
'A3, start listing all the names of the worksheets
'in the workbook advancing the cursor one cell down.
Line1:
Worksheets("TOC").Select
Worksheets("TOC").Range("A3").Select
Worksheets("TOC").Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.ClearContents
Worksheets("TOC").Range("a3").Activate
For Each ws In Worksheets
If ws.Name <> "Sheet Names" Then
ActiveCell.Formula = ws.Name
ActiveCell.Offset(1, 0).Select
End If
Next
End Sub
Sub yListAllSheetNamesInWorkbook()
For i = 1 To Sheets.Count
cells(i, 1) = Sheets(i).Name
Next i
End Sub