Row Number in With Value Exists in One Column AND A second value exists in a second column

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I usually use the MATCH function to find a particular row number based on the criteria I have available.

For example
Code:
trew = Application.WorksheetFunction.Match(RID, ws_psttemp.Columns("A"), 0)
Will provide me the row number in which the value of RID can be found in column A of worksheet ws_psttemp.

I need to take this one set further by adding a second criteria. I'm not sure if I can use the MATCH function anymore

So, what I need to do is find the first row number in which column A = the value of RID AND column B = "Diamond"

Is anyone able to suggest a vba approach to this?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this

Code:
    n = ws_psttemp.Name
    trew = Evaluate("=MATCH(""" & rid & """&""Diamond""," & n & "!A1:A100&" & n & "!B1:B100,0)")
 
Upvote 0

Forum statistics

Threads
1,216,890
Messages
6,133,299
Members
449,796
Latest member
Fuji

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