Private Sub CommandButton1_Click()
Dim o As Object, i&, t$, liste$(), n&, c As Range
'---liste des procédures Sub---
For Each o In ThisWorkbook.VBProject.VBComponents
With o.CodeModule
For i = 1 To .CountOfLines
t = Trim(.Lines(i, 1))
If t Like "Sub*" Then
t = Mid(t, 5, InStr(t, "(") - 5)
n = n + 1
ReDim Preserve liste(1 To n)
liste(n) = t
End If
Next
End With
Next
'---RAZ---
Application.ScreenUpdating = False
[A2:A65536].ClearContents
For Each o In Me.Shapes
If o.TopLeftCell.Column = 2 Then o.Delete
Next
'---création de la liste et des boutons---
If n Then
With [A2].Resize(UBound(liste))
.Value = Application.Transpose(liste)
.Sort [A2], Header:=xlNo 'tri
For Each c In .Cells
With Me.Buttons.Add(c(1, 2).Left, c.Top, c(1, 2).Width, c.Height)
.Characters.Text = c
.OnAction = c.Text
End With
Next
End With
End If
End Sub