Ist es möglich bzw. sinnvoll, die nachstehenden Funktionen zusammen zu fassen?
Wenn ja, wie bitte? Public Function DNR(Wert As String) Dim myRange As Range, lZahl As Long, intI As Integer Set myRange = wksIndex.Range("C2:C300") lZahl = Application.WorksheetFunction.CountA(myRange) For intI = 2 To lZahl With wksIndex.Cells(intI, 2) If .Text = Wert Then DNR = .Offset(0, 2) Exit For Else DNR = "" End If End With Next End Function
Public Function VorName(Wert As String)
Dim myRange As Range, lZahl As Long, intI As Integer
Set myRange = wksIndex.Range("C2:C300")
lZahl = Application.WorksheetFunction.CountA(myRange)
For intI = 2 To lZahl
With wksIndex.Cells(intI, 2)
If .Text = Wert Then
VorName = .Offset(0, 1)
Exit For
Else
VorName = ""
End If
End With
Next
End Function
Public Function Verwendung(Wert As String)
Dim myRange As Range, lZahl As Long, intI As Integer
Set myRange = wksIndex.Range("C2:C300")
lZahl = Application.WorksheetFunction.CountA(myRange)
For intI = 2 To lZahl
With wksIndex.Cells(intI, 2)
If .Text = Wert Then
Verwendung = .Offset(0, 3)
Exit For
Else
Verwendung = ""
End If
End With
Next
End Function
Public Function Gruppe(Wert As String)
Dim myRange As Range, lZahl As Long, intI As Integer
Set myRange = wksIndex.Range("C2:C300")
lZahl = Application.WorksheetFunction.CountA(myRange)
For intI = 2 To lZahl
With wksIndex.Cells(intI, 2)
If .Text = Wert Then
Gruppe = .Offset(0, 4)
Exit For
Else
Gruppe = ""
End If
End With
Next
End Function
Public Function Schema(Wert As String)
Dim myRange As Range, lZahl As Long, intI As Integer
Set myRange = wksIndex.Range("C2:C300")
lZahl = Application.WorksheetFunction.CountA(myRange)
For intI = 2 To lZahl
With wksIndex.Cells(intI, 2)
If .Text = Wert Then
Schema = .Offset(0, 5)
Exit For
Else
Schema = ""
End If
End With
Next
End Function
Danke für die Mühe(n) & Gruß Lorenz