Greetings,
I would like the ability to check to see if the values I have located in Column A are present (detected) on another worksheet within the same workbook.
For clarification, I feel as though I've come up with a solution but I'd like feedback if the method I've used is the most efficient way for Excel to return the result I'm looking to achieve or if there is a better alternate method.
STEPS TAKEN:
I attempted an INDEX & MATCH solution as I understand it's a more efficient search method in Excel but was unsuccessful in getting it to work (due to my limited knowledge). Therefore, I created a VLOOKUP function and pointed the array to the exact column the list of values exist and that worked fine (because the values I'm searching for isn't in the left most column in the array).
INTENDED RESULTS:
When an exact match is found, return nothing ("")
When no match is found, return "XXX"
The code I've come up with thus far is:
FORUM POST OBJECTIVES
Thanks in advance.
I would like the ability to check to see if the values I have located in Column A are present (detected) on another worksheet within the same workbook.
For clarification, I feel as though I've come up with a solution but I'd like feedback if the method I've used is the most efficient way for Excel to return the result I'm looking to achieve or if there is a better alternate method.
STEPS TAKEN:
I attempted an INDEX & MATCH solution as I understand it's a more efficient search method in Excel but was unsuccessful in getting it to work (due to my limited knowledge). Therefore, I created a VLOOKUP function and pointed the array to the exact column the list of values exist and that worked fine (because the values I'm searching for isn't in the left most column in the array).
INTENDED RESULTS:
When an exact match is found, return nothing ("")
When no match is found, return "XXX"
The code I've come up with thus far is:
VBA Code:
Sub D_ActiveChecks()
With Worksheets("MIN_QTY").Range("B2").CurrentRegion.Columns("B")
'=IF(A2=IFERROR(VLOOKUP(A2,ACTIVE!G:G,1,0),""),"","XXX")
.Offset(1, 1).Resize(.Rows.Count - 1, 1).FormulaR1C1 = _
"=IF(RC[-2]=IFERROR(VLOOKUP(RC[-2],ACTIVE!C[4],1,0),""""),"""",""XXX"")"
.Value = .Value
End With
End Sub
FORUM POST OBJECTIVES
- Determine if the code above is the best solution
- Have the results sorted so that all the "XXX" entries appear at the top of the list
- The output from the VBA function remains in Formula form, I would prefer the results be in static (PASTE VALUES) format
Book2 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | SKU | MIN QTY | ACTIVE CHECK | ||
2 | TEST-12345-QTY4 | 2 | |||
3 | TEST-12345-QTY2 | 2 | |||
4 | TEST-12345-QTY3 | 2 | |||
5 | TEST-12345-QTY3-001 | 2 | XXX | ||
SKU |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:C5 | C2 | =IF(A2=IFERROR(VLOOKUP(A2,ACTIVE!G:G,1,0),""),"","XXX") |
Book2 | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | local_id | vendor_url | vendor_variant | vendor_stock | vendor_price | vendor_shipping | reference | ||
2 | 1.87E+08 | https://www.sample.com | 1 | 9.98 | 0 | TEST-12345-QTY4 | |||
3 | 1.87E+08 | https://www.sample.com | 1 | 20.88 | 3.98 | TEST-12345-QTY2 | |||
4 | 1.87E+08 | https://www.sample.com | 1 | 10.54 | 5 | TEST-12345-QTY3 | |||
ACTIVE |
Thanks in advance.