“Unable to get the Match property of the WorksheetFunction class”

Marsmuncher

New Member
Joined
Sep 2, 2014
Messages
4
Hello,

I am unable to get this code to work. What is happening is I am trying to make a String of Prod obtain data relevant to what is matched. I have two worksheets in the same workbook. One named "Database" and one named "Datasheet". I am trying to match the values of column B from "Database" with the data from column E from "Datasheet" by using the INDEX and MATCH functions in VBA. Below is my code:

Private Sub Rdson_Update_Click()
Dim Prod As String

'Calling Module 4
Call Rdson_Data

Prod = Application.WorksheetFunction.Index(Sheets("Database").Range("B:B"), Application.WorksheetFunction.Match(1, Sheets("Datasheet").Range("E:E"), 0), 0)

End Sub

However I always get one of two errors, one of them being “Unable to get the Match property of the WorksheetFunction class” and the other being "Application-defined or object-defined error"

The Call Rdson_Data is a module that brings the datasheet from another Excel file, and I have this working perfectly, so I know this is not the problem. The Data itself is package numbers i.e. LM339-10.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
The error means that the value 1 can't be found in column E on the Datasheet sheet.
 
Upvote 0
Your Match function is looking for the value 1, is that right?
 
Upvote 0
Ah, No it isn't, it appears I found my mistake, what I am trying to achieve is my match function to scan all the contents with column E from "Datasheet" and to then match it with all the contents from column B in in "Database"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,958
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top