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,616
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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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