Sub 인덱스만들기()

    Dim 인덱스 As Worksheet
    Dim 워크시트 As Worksheet
    Dim i As Integer
    
    Set 인덱스 = ActiveSheet

    For Each 워크시트 In ThisWorkbook.Worksheets
    
        If 워크시트.Name <> 인덱스.Name Then
    
            With 인덱스
                .Range("B6").Offset(i).Value = 워크시트.Name
                .Range("C6").Offset(i).Value = "-------------------------"
                .Hyperlinks.Add Anchor:=.Range("F6").Offset(i), _
                                Address:="", _
                                SubAddress:=워크시트.Name & "!A1", _
                                TextToDisplay:="바로가기"
            End With
            
            i = i + 1
           
            With 워크시트
                .Rows(1).Interior.Color = RGB(220, 220, 220)
                .Hyperlinks.Add Anchor:=.Range("A1"), _
                                Address:="", _
                                SubAddress:=인덱스.Name & "!A1", _
                                TextToDisplay:="인덱스"
            End With
                    
        End If
       
    Next

End Sub