Sub CheckProjects()
'set a reference to the VBA Extensibility Library
    Dim VBEditor As VBIDE.VBE
    Dim VBProj As VBIDE.VBProject
    Dim VBComp As VBIDE.VBComponent
    Dim CodeMod As VBIDE.CodeModule
    Dim modname
    Dim a, afin, b, bfin, c, cfin, ch, chfin, myn
    Dim mtxtline, mtxtsub
    
    Set VBEditor = Application.VBE
    Set VBProj = VBEditor.ActiveVBProject
    myn = MsgBox("Show procedures in Debug.print?", vbYesNo)
    
    Debug.Print VBProj.Name
    Debug.Print "----------"
    
    afin = VBProj.VBComponents.Count
    For a = 1 To afin
        Set VBComp = VBProj.VBComponents(a)
        Set CodeMod = VBComp.CodeModule
        Debug.Print ""
        Debug.Print "Total No of lines: " & CodeMod.CountOfLines & vbTab & vbTab & VBComp.Name
        bfin = CodeMod.CountOfLines
        If myn = vbYes Then
            For b = 1 To bfin
                mtxtline = CodeMod.Lines(b, 1)
                If Left(mtxtline, 11) = "Private Sub" _
                Or Left(mtxtline, 10) = "Public Sub" _
                Or Left(mtxtline, 12) = "Friendly Sub" _
                Or Left(mtxtline, 10) = "Static Sub" _
                Or Left(mtxtline, 3) = "Sub" _
                Or Left(mtxtline, 16) = "Private Function" _
                Or Left(mtxtline, 15) = "Public Function" _
                Or Left(mtxtline, 17) = "Friendly Function" _
                Or Left(mtxtline, 15) = "Static Function" _
                Or Left(mtxtline, 8) = "Function" Then
                    mtxtsub = mtxtline
                    c = b
                ElseIf Left(mtxtline, 7) = "End Sub" _
                Or Left(mtxtline, 12) = "End Function" Then
                    cfin = b
                    Debug.Print vbTab & "Lines:" & vbTab & c & vbTab _
                    & "to" & vbTab & cfin & vbTab & vbTab & mtxtsub
                End If
            Next
        End If
    Next
End Sub