របៀបបង្កើត Worksheets ជា List ក្នុង Excel

1.ចូលទៅដាក់ធិចនៅលើ Develop

Developer 

2. កូពីកូដបន្ទាប់មក Run

Sub CreateIndex()

    Dim xAlerts As Boolean

    Dim I  As Long

    Dim xShtIndex As Worksheet

    Dim xSht As Variant

    xAlerts = Application.DisplayAlerts

    Application.DisplayAlerts = False

    On Error Resume Next

    Sheets("Index").Delete

    On Error GoTo 0

    Set xShtIndex = Sheets.Add(Sheets(1))

    xShtIndex.Name = "Index"

    I = 1

    Cells(1, 1).Value = "INDEX"

    For Each xSht In ThisWorkbook.Sheets

        If xSht.Name <> "Index" Then

            I = I + 1

            xShtIndex.Hyperlinks.Add Cells(I, 1), "", "'" & xSht.Name & "'!A1", , xSht.Name

        End If

    Next

    Application.DisplayAlerts = xAlerts

End Sub

 

Create Hyperlinked Index Of Sheets In Excel Workbook