Re: Procs im Codemodule auflisten
15.05.2003 13:07:29
L.Vira
das bietet VBext leider nicht an aber so gehts:Option Explicit
Sub MakroListe()
Dim objVBA As Object, bolFound As Boolean
Dim c As Long, r As Long, i As Long, strCode As String
Cells.Clear
r = 1
c = 1
For Each objVBA In ThisWorkbook.VBProject.VBComponents
If objVBA.Type <> 11 Then
Cells(r, c) = objVBA.Name
Rows(r).Font.Bold = True
r = r + 1
With objVBA.CodeModule
For i = 1 To .CountOfLines
bolFound = False
Select Case Left(.Lines(i, i), 3)
Case "Fun": bolFound = True
Case "Pri": bolFound = True
Case "Pro": bolFound = True
Case "Pub": bolFound = True
Case "Sub": bolFound = True
Case Else: bolFound = False
End Select
If bolFound Then
strCode = .Lines(i, i)
If InStr(strCode, Chr(13)) > 0 Then
strCode = Left(strCode, InStr(strCode, Chr(13)) - 1)
End If
Cells(r, c) = strCode
r = r + 1
End If
Next
End With
End If
Next
Cells.Columns.AutoFit
End Sub