I'm trying to lookup an ID from column I, in column A. This is the code I'm using:
Dim x As Long
lr = Worksheets("Risk Explorer greeks").Cells(Rows.Count, "I").End(xlUp).Row
Range("J2:J2" & lr).FormulaR1C1 = "=VLOOKUP(RC[-1], R1C1:R50000C1, 1, False)"
I only have ~40,000 values in column J, however when I run this code it ends up populating all the way down to cell 237,000 - how can I amend the code so that it only looks up column J where it has a value, and doesnt lookup loads of blank cells?
Alternatively if there is a faster way to do this lookup rather than the above formula, then pls suggest - I'd be grateful for any help!
"=VLOOKUP(RC[-1], R1C1:R50000C1, 1, False)"
for"=INDEX( R1C1:R50000C1,MATCH(RC[-1], R1C1:R50000C1,0))"
. – Gravitate