In order to be able to replicate something like the MATCH function, which accepts a String (or cell reference), an Array of Strings (or a range of cells) and then the match type as parameters, how do I declare such a function header?
I had thought something like this would do, but it is returning #VALUE without executing any of the function. It is something to do with the Array of Strings that is causing the problem.
Public Function SortOfLikeUhYouKnowKindOfMatch( _
sLookupValue As String _
, saLookupArray() As String _
, Optional iMatchType As Integer = 0 _
) As Integer
I don't want to declare a Range for the lookup array because I also want the function to be able to accept an array of literal strings instead of a range of cells as worksheet functions are wont to do.
Bookmarks