Solved

MS Excel VBA match function for an array

Posted on 2011-09-08
1
319 Views
Last Modified: 2012-08-13
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 "unable to get the match property of the WorksheetFunction class.  The arrays in the code below are defined as follows:
ReportArray(200,8) and ProdArray(200,2) - the common field in both is ID.

Below is the code generating the error message:
    For x = 1 To RptRows
        ID = ReportArray(x, 1)
        ID_Fnd = WorksheetFunction.Match(ID, ProdArray, 0)   ' (error is generated here)
        ReportArray(x, 7) = ProdArray(GPN_Fnd, 2)
    Next x
0
Comment
Question by:uad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 36504314
Change:

      ID_Fnd = WorksheetFunction.Match(ID, ProdArray, 0)   ' (error is generated here)

To:

      ID_Fnd = Application.Match(ID, ProdArray, 0)   ' (error is generated here)

Kevin
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question