z.B. so:
Sub GetProcType()
With ActiveWorkbook.VBProject.VBComponents("Modul1").CodeModule
Proc = .ProcOfLine(5, 0)
Start = .ProcBodyLine(Proc, 0)
Defline = .Lines(Start, 1)
Def = Trim(Left(Defline, InStr(Defline, Proc) - 1))
Proctype = IIf(InStr(Def, "Function") > 0, "Function", IIf(InStr(Def, "Property") > 0, "Property", "Sub"))
End With
End Sub
Gruß Mr. K.
|