The code I ended up going with was this, and it works fine
Function cvl(aName As String, myRange As range, myColumn As Integer) As Variant
cvl = Application.VLookup("*" & aName & "*", myRange, myColumn, False)
End Function
I decided that I actually want to make the range and column static as well. I tried a few different things but none of them have worked so far. This was my last attempt but it just returns 0 all the time.
Function cvl(aName As String) As Variant
cvl = Application.VLookup("*" & aName & "*", range(A1, D40), 4, False)
End Function
Thoughts?
Thanks so much!
Bookmarks