Error Finding Match When There Is Indeed A Match

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have run into a problem which likely has a very easy solution, but I just can't seem to figure it out.

Consider these couple of lines of code from a larger module ...

Rich (BB code):
    crid = ws_master.Cells(tmrow, 1)
    cdrow = Application.WorksheetFunction.Match(crid, ws_cd.Columns(1), 0)

crid = "44779003" - this is correct
However, when I try to get the value of cdrow, the line in red leaves me with an "Unable to get the Match property of the WorksheetFunction class" error.
The value 44779003 does truly exist in workbook ws_cd at cell A4 as a number. I'm not sure why the error.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Pretty much guaranteed that either one is stored as a number (will default to right alignment in the cell) and the other as text (left-aligned by default), or your variable type is wrong (eg a String).
 
Upvote 0
Solution
Thanks Rory ... the error was in my declarations.
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

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