Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function CustomVLookup(ByVal Lookup_Val As Range, Table_Array As Range, ColIndex As Integer) As String
- Dim x, dict
- Dim i As Long
- x = Table_Array.Value
- Set dict = CreateObject("Scripting.Dictionary")
- For i = 1 To UBound(x, 1)
- If x(i, 1) = Lookup_Val.Value Then
- dict.Item(x(i, ColIndex)) = ""
- End If
- Next i
- If dict.Count > 0 Then
- CustomVLookup = Join(dict.keys, ", ")
- Else
- CustomVLookup = ""
- End If
- End Function
- =CustomVLookup(A2,F2:G25,2)
Add Comment
Please, Sign In to add comment