MS Excel VBA Match Function
Posted on 2011-09-08
continuation of prior issue: I am trying to build an array to generate a report. The data for the report is stored in various arrays, but when I use the MATCH function I am presented with "type-mismatch" yet the the common field in both arrays that I am searching on is variant\string in both. The arrays in the code below are defined as follows: ReportArray(200,8) and ProdArray(200,2).
My question is two-fold - Can Match be used on two multidirectional arrays? Why am I getting a "type-mismatch" when both arrays show the search as being variant\string in the "watch" area.
Below is the code generating the error message:
For x = 1 To RptRows
ID_Fnd = Application.Match(ReportArray(x, 1), ProdArray, 0) ' (error is generated here)
ReportArray(x, 7) = ProdArray(GPN_Fnd, 2)