so vielleicht?...
16.07.2004 10:32:10
joel
hallo udo
eine hand wäscht die andere :-)
bin zwar immer noch auf der suche nach einer eigenschaft, die den typ der Funktion/prozedur als konstante ausgiebt, mit der "lines"-eigenschaft lässt sich das aber zumindest mal lösen
gruss joel
Sub MakroListe()
Dim vbc As Object, sh As Worksheet
Dim iRow As Integer, iCol As Integer, iCounter As Integer
Dim sMacro As String
Set sh = ThisWorkbook.Sheets(1)
sh.Cells.Clear
sh.Rows(1).Font.Bold = True
iRow = iRow + 1
iCol = 1
For Each vbc In ActiveWorkbook.VBProject.VBComponents
With vbc.CodeModule
For iCounter = 1 To .CountOfLines
If .ProcOfLine(iCounter, vbext_pk_Proc) > "" Then
sMacro = .ProcOfLine(iCounter, vbext_pk_Proc)
'##### NEU
sLine = .Lines(iCounter, 1)
If sLine Like "Public Sub*" Then
sh.Rows(iRow).Font.ColorIndex = 5
End If
If sMacro <> sh.Cells(iRow, iCol) Then
iRow = iRow + 1
sh.Cells(iRow, iCol).Value = sMacro
End If
End If
Next iCounter
End With
Next vbc
sh.Columns.AutoFit
End Sub