Macro to create the Table of Contents

Create the list of worksheets with Hyperlinks (Table of Contents)

Sub CreateTableOfContents()
Dim x As Long
ThisWorkbook.Sheets.Add Before:=ThisWorkbook.Worksheets(1)
ActiveSheet.Name = "Table Of Contents"
For x = 1 To Sheets.Count
ActiveSheet.Cells(x, 1).Select
ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Cells(x, 1), Address:="",SubAddress:="'" & Sheets(x).Name & "'!A1", TextToDisplay:=Sheets(x).Name
Next x
End Sub

How to use codes shared here?