Sie können eine Benutzerfunktion Schleife erstellen, die Werte durch die Funktion SVERWEIS:
Function VLOOKUPARRAY(ByVal lookup_val As Range, ByVal table_array As Range, ByVal col_index_num As Integer, Optional ByVal range_lookup As Integer = 0) As String
Dim s As String
Dim a1() As String
Dim a2() As Variant
Dim i As Integer
'Recalculate whenever a calculation happens on the worksheet
Application.Volatile
'Get the lookup value from the cell
s = lookup_val.Value
'Split into array
a1 = Split(s, ",")
'Set output array to input array dimensions
ReDim a2(0 To UBound(a1))
'Loop through input array and set output array elements to lookup results using application lookup function.
For i = 0 To UBound(a1)
a2(i) = Application.WorksheetFunction.VLookup(Trim(a1(i)), table_array, col_index_num, range_lookup)
Next i
'Loop through output array and load values into a string
s = ""
For i = 0 To UBound(a2)
s = s & a2(i) & ", "
Next i
'Knock the final ", " off the end of the string
s = Left(s, Len(s) - Len(", "))
'Set function output to string value.
VLOOKUPARRAY = s
End Function
, die schnell und schmutzig war, aber es gab mir die gewünschte Ausgabe. Passen Sie wie erforderlich an.
Es ist aus Ihrer Frage nicht klar, was Sie erreichen wollen. Versuchen Sie, ein Beispiel und ein erwartetes Ergebnis anzugeben, damit andere Sie verstehen. – tarashypka
@tarashpka Überprüfen Sie, ob dies hilft – rockedbyjava