Gruppe
UDF
Problem
Die benutzerdefinierte Funktion in Spalte C liefert die in Tabelle2 hinterlegten Kategorien.
StandardModule: Modul1
Function Zuordnung(sTxt As String, rng As Range) As String
Dim wks As Worksheet
Dim iRow As Integer
Set wks = Worksheets("Tabelle2")
iRow = 1
Do Until IsEmpty(wks.Cells(iRow, 1))
If InStr(sTxt, wks.Cells(iRow, 1).Value) Then
Zuordnung = wks.Cells(iRow, 2).Value
Exit Function
End If
iRow = iRow + 1
Loop
Zuordnung = "#NV"
End Function