Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created March 8, 2019 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndthanh/fbfcd314d602286dab1d7469e2e2ae0a to your computer and use it in GitHub Desktop.
Save ndthanh/fbfcd314d602286dab1d7469e2e2ae0a to your computer and use it in GitHub Desktop.
Function myVlookUp(lookup_value, lookup_range As Range, index_col As Long)
Dim x As Range
Dim result As String
result = ""
For Each x In lookup_range
If x = lookup_value Then
result = result & "," & x.Offset(0, index_col - 1)
End If
Next
myVlookUp = Right(result, Len(result) - 1)
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment