Attribute VB_Name = "modSearchProz"
Option Explicit
Dim vbp As VBProject
Dim vbc As VBComponent
Dim vbCode As CodeModule
Sub subSearchProzedureName()
    Dim strVBC As String
    Dim strTyp As String
    Dim intLine As Integer
    Dim intProcStart As Integer, intProcLines As Integer
    Dim strProc As String, strVBCName As String, intProcType As Integer
    Dim strMsg As String, strSearch
    strSearch = "StiftFarbe" '"Test445"
    For Each vbp In VBE.VBProjects
      If vbp.Protection = vbext_pp_none Then
        For Each vbc In vbp.VBComponents
          Set vbCode = vbc.CodeModule
          With vbCode
            For intLine = 1 To vbCode.CountOfLines
              strProc = .Lines(intLine, 1)
              On Error Resume Next
              strProc = .ProcOfLine(intLine, vbext_pk_Proc)
              intProcStart = .ProcStartLine(strProc, vbext_pk_Proc)
              If intProcStart = 0 Then
                  intProcStart = .ProcStartLine(strProc, vbext_pk_Get)
                  If intProcStart = 0 Then
                     intProcStart = .ProcStartLine(strProc, vbext_pk_Let)
                     If intProcStart = 0 Then
                        intProcStart = .ProcStartLine(strProc, vbext_pk_Set)
                        intProcType = vbext_pk_Set
                     Else
                        intProcType = vbext_pk_Let
                     End If
                  Else
                     intProcType = vbext_pk_Get
                  End If
               Else
                     intProcType = vbext_pk_Proc
               End If
              On Error GoTo 0
              MsgBox intProcType, vbInformation, strProc
              'Next vbc
              Select Case intProcType
              Case vbext_pk_Get
                 strProc = .ProcOfLine(intLine, vbext_pk_Get)
                 If strProc = strSearch Then
                     intProcStart = .ProcStartLine(strProc, vbext_pk_Get)
                     intProcLines = .ProcCountLines(strProc, vbext_pk_Get)
                     strMsg = .Lines(intProcStart, intProcLines)
                     strVBCName = vbp.FileName & "/" & vbc.Name
                     Exit For
                  End If
             Case vbext_pk_Let
                 strProc = .ProcOfLine(intLine, vbext_pk_Let)
                 If strProc = strSearch Then
                     intProcStart = .ProcStartLine(strProc, vbext_pk_Let)
                     strMsg = .Lines(intProcStart, .ProcCountLines(strProc, vbext_pk_Let))
                     strVBCName = vbp.FileName & "/" & vbc.Name
                     Exit For
                  End If
             Case vbext_pk_Set
                 strProc = .ProcOfLine(intLine, vbext_pk_Set)
                 If strProc = strSearch Then
                     intProcStart = .ProcStartLine(strProc, vbext_pk_Set)
                     strMsg = .Lines(intProcStart, .ProcCountLines(strProc, vbext_pk_Set))
                     strVBCName = vbp.FileName & "/" & vbc.Name
                     Exit For
                  End If
              Case vbext_pk_Proc
                 strProc = .ProcOfLine(intLine, vbext_pk_Proc)
                 If strProc = strSearch Then
                     intProcStart = .ProcStartLine(strProc, vbext_pk_Set)
                     strMsg = .Lines(intProcStart, .ProcCountLines(strProc, vbext_pk_Proc)) & vbCrLf
                     strVBCName = vbp.FileName & "/" & vbc.Name
                     Exit For
                  End If
              End Select
            Next intLine
            End With
          Next vbc
        End If
    Next
    MsgBox strMsg, vbInformation, strVBCName
End Sub
