“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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,378
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
The error means that the value 1 can't be found in column E on the Datasheet sheet.
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
Your Match function is looking for the value 1, is that right?
 
Upvote 0

Marsmuncher

New Member
Joined
Sep 2, 2014
Messages
4
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,191,043
Messages
5,984,321
Members
439,882
Latest member
gerdc

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
Top