Sub ListaHoja()
'--------------------------------------------------
' Detiene momentaneamente los mensajes de Excel
'--------------------------------------------------
Application.ScreenUpdating = False
Application.DisplayAlerts = False
'--------------------------------------------------
' añade la hoja ListaPestañas en primer lugar
' y elimina la que existe
'--------------------------------------------------
If Sheets(1).Name = "ListaPestanias" Then Sheets("ListaPestanias").Delete
    Sheets.Add After:=ActiveSheet
    ActiveSheet.Name = "ListaPestanias"
    Sheets("ListaPestanias").Move Before:=Sheets(1)
'--------------------------------------------------
' fondo de la hoja ListaPestanias
'--------------------------------------------------
Cells.Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorDark2
        .TintAndShade = -9.99786370433668E-02
        .PatternTintAndShade = 0
    End With
'--------------------------------------------------
' título de la hoja ListaPestanias
'--------------------------------------------------
Range("B2:H2").Select
    ActiveCell.FormulaR1C1 = "lista de las pestañas del libro"
    Range("B2:H2").Select
    Range("C2").Activate
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Selection.Merge
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlMedium
    End With
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
'--------------------------------------------------
' añade como columna B del nombre de las hojas
' et en C du lien hypertexte
'--------------------------------------------------
    Numsheets = Sheets.Count
    For i = 1 To Numsheets
        Range("B" & i + 2).Select
        ActiveCell.Value = Sheets(i).Name
        Range("C" & i + 2).Select
        ActiveCell.FormulaR1C1 = "=HYPERLINK(""#'""&RC[-1]&""'!a1"",""ver la zona"")"
    Next i
    Columns("B:D").EntireColumn.AutoFit
'--------------------------------------------------
' reactiva los mensajes de Excel
'--------------------------------------------------
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
End Sub
