I'm working with a two very large tables and I'm trying to use vba and vlookups to match the data in one with the other.
The worksheets are each one column and are structured like below:
Reference Sheet:
ID_Ref (2/4)
Q1234
W1234
R1234
...
Lookup Sheet
ID_Lookup
Q1234
P1234
X1234
...
I'm interested in identifying the rows that are in the Lookup SHeet but not in the Reference Sheet. I have a huge quantity of rows in each sheet (~130k in the Lookup and 90k in the Reference) and and excel kept crashing when I tried to enter the formulas manually.
As a result I'm trying to work with VBA to automate the process. The issue is that the below function returns 0 for most of the rows and I can't figure out why.
Sub Vlookup()
With Sheets("Lookup).Range("B3:B133780")
.FormulaR1C1 = _
"=IF(VLOOKUP(RC[-1],2_4!R1C1:R79145C1,1)=RC[-1],VLOOKUP(RC[-1],2_4!R1C1:R79145C2,1,FALSE),VLOOKUP(RC[-1],2_4!R1C1:R79145C2,1,FALSE))"
.Value = .Value
End With
End Sub
Any help is appreciated!
EDIT 5/13:
I tried the methods mentioned by @HarveyFrench and @Jeeped and got two different results.
Copying down:
=NOT(ISNA(VLOOKUP($A2,'2_4'!$A$1:$A$79145,1, FALSE)))
yields a different number of non-matching records than copying down
=IFERROR(MATCH(A2,'2_4'!$A$1:$A$79145,0),"")
Am I doing something wrong here?