Solved

MS Excel VBA match function for an array

Posted on 2011-09-08
1
267 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
1 Comment
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now