Hi Guys!

I have a user defined function which essentially performs a VLOOKUPand then CONCATENATES all the results in one cell. However, the result is #NAME? and I can't seem to suss it out!

Function calVlookup(lookupval, lookuprange As Range, indexcol As Long)
Dim x As Range
Dim result As String
result = ""
For Each x In lookuprange
    If x = lookupval Then
        result = result & " " & x.Offset(0, indexcol - 1)
    End If
Next x
calVlookup = result

End Function