VBA Code for MATCH function with multiple criteria

Taf

New Member
Joined
May 2, 2003
Messages
49
I am attempting to find the row number of the record which matches multiple criteria. Below are the codes that I have attempted to use but each of those is to no avail. Can you please help in identifying where I am going wrong

FOUNDrow = WorksheetFunction.Match(1, WorksheetFunction.Index(([Range1] = Var1) * ([Range2] = Var2) * ([Range3] = -Var3) * ([Range4] = "[N]"), 0, 1), 0)
FOUNDrow = WorksheetFunction.Match(Var1 & Var2 & -Var3 & "N", [Range1] & [Range2] & [Range3] & [Range4], 0)
FOUNDrow = Evaluate("Match(1, Index(([Range1] = " & Var1 & ") * ([Range2] = " & Var2 & ") * ([Range3] = " & -Var1 & ") * ([Range4] = ""[N]""), 0, 1), 0)
FOUNDrow = Evaluate("=Match(1, Index(([Range1] = " & Var1 & ") * ([Range2] = " & Var2 & ") * ([Range3] = " & -Var1 & ") * ([Range4] = ""[N]""), 0, 1), 0)

Many Thanks in Advance
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Explain at least what you are searching for, or it's a challenge for some mind readers forum !​
 
Upvote 0
Sorry about that ... Basically I have a worksheet of inventory log events. In another worksheet I have a customer return record event. I would like to pick up the data from the second worksheet i.e. Var1 (SKU code), Var2 (Date), Var3 (Qty). The idea is to find the even in the inventory log by searching in the relevant columns i.e. Range1 (with SKU Codes), Range2 (with Dates), Range3 (with Qty) - but in this case it must be negative of the variable (i.e. Var3 is likely to show -1, but we will need to search for +1 since stock will increase), and Range4 (where we search for the relevant code [N] associated with returns).
 
Upvote 0
Thanks @Marc L for looking into it but I think I have found a solution. Posting it below for anybody in the future

Evaluate("Match(""" & Va1 & -EVENTSqty & EVENTSdate & EVENTSttype & """, r_Events_ASIN & r_Events_ShippedQty & r_Events_Date & R_Events_Adj_Reason,0)")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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