Dim wsSheet As Worksheet
Dim ws As Worksheet
Dim Counter As Long
On Error Resume Next
Set wsSheet = Sheets ("Mucluc")
'Check Check Sheet
On Error GoTo 0
If wsSheet Is Nothing Then
' Neu chua added in the first place of Workbook
Set wsSheet = ActiveWorkbook.Sheets.Add (Before: = Worksheets (1))
wsSheet.Name = "Mucluc"
End If
With wsSheet
.Cells (2, 1) = "LIST SACH CAC SHEET "
.Cells (2, 1) .Name =" Index "
.Cells (4, 1)
.Value =" STT " .Cells (4, 2) .Value =" Ten Sheet "
End With
'Merge Cell
With Range ("A2: B2")
.Merge
.HorizontalAlignment = xlCenter
.Font.Bold = True
End With
'Set ColumnWidth
With Columns ("A: A").
ColumnWidth = 8
.HorizontalAlignment = xlCenter
End With
With Range ("A4")
.HorizontalAlignment = xlCenter
.Font.Bold = True
End With
Columns ("B: B"). ColumnWidth = 30
With Range ("B4")
.HorizontalAlignment = xlCenter
.Font.Bold = True
End With
Counter = 1
For Each ws In Worksheets
If ws.Name <> wsSheet. Name Then
'Find the value of
wShSheet.Cells (Counter + 4, 1). Value = Counter
' Create contact
wsSheet.Hyperlinks.Add Anchor: = wsSheet.Cells (Counter + 4, 2), _
Address: = "", _
SubAddress: = ws.Name & "! A1", _
ScreenTip: = ws.Name, _
TextToDisplay: = ws.Name
'Add Button Return Sheet
With New Sheet With ws
.Hyperlinks.Add Anchor: =. Range ("H1"), Address: = "", SubAddress: = "Index", TextToDisplay: = "Dial ve "
End With
Counter = Counter + 1
End If
Next ws
Set xlSheet = Nothing
End Sub
Step 4: Then you click Run -> Run Sub or F5 key to run the program.
Now on your Excel file will have a Mucluc sheet and in it is a table of contents for the list of sheets in Excel. Which sheet you want to open, all you need to do is click the mouse on the sheet name in the list of sheets.
So with two ways of creating a table of contents for a list of sheets in Excel, hopefully you can apply it easily with your Excel file. Good luck!