Sub sommaireDynamique()
Dim feuille As Worksheet, bouton As Shape, positionY&
If ActiveSheet.Name <> "Feuil1" Then Exit Sub 'Adapter le nom de la feuille
For Each bouton In ActiveSheet.Shapes
If bouton.Name Like "menu_*" Then
bouton.Delete
End If
Next
positionY = 4
For Each feuille In Worksheets
If feuille.Visible Then
Set bouton = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 4, positionY, [a1].Width - 8, 30)
bouton.TextFrame2.TextRange.Characters.Text = feuille.Name
If feuille.Name = ActiveSheet.Name Then
bouton.ShapeStyle = msoShapeStylePreset14
Else
bouton.ShapeStyle = msoShapeStylePreset13
End If
ActiveSheet.Hyperlinks.Add Anchor:=bouton, Address:="", SubAddress:="'" & feuille.Name & "'!A1"
bouton.Name = "menu_" & feuille.Name
positionY = positionY + 30
End If
Next
End Sub