Sub listeMacros()
'Nécéssite d'activer la référence
'"Visual basic For Application Extensibility 5.3"
'
Dim i As Integer, Ajout As Integer, x As Integer
Dim Msg As String
Dim VBCmp As VBComponent
Dim Wb As Workbook
'Indiquez le nom du classeur ouvert
'Set Wb = ThisWorkbook
Set Wb = Workbooks("Classeur1.xls")
Ajout = 1
For Each VBCmp In Wb.VBProject.VBComponents
Msg = VBCmp.Name
With Cells(Ajout, 1)
.Interior.ColorIndex = 6
.Value = Msg
End With
x = Wb.VBProject.VBComponents(Msg).CodeModule.CountOfLines
For i = 1 To x
Cells(Ajout + i, 1) = _
Wb.VBProject.VBComponents(Msg).CodeModule.Lines(i, 1)
Next
Ajout = Ajout + x + 2
Next VBCmp
End Sub