help with vlookup in macro

H

Himansu

Hello everyone,

Anyone know what's wrong with this formula? It's embedded in a macro that
I'm writing.
 
H

Himansu

here's the formula:


ActiveCell.FormulaR1C1 =
"VLOOKUP(LEFT(rc1,4)&"2"&RIGHT(rc1,LEN(rc1)-5)," & JobNumber &
"_keycodes!R1C1:R150C3,3,FALSE)"
 
M

Mike H

Hi,

The 2 between the 2 strings is a bit confusing. I assume you want this

ActiveCell.Formula = "=VLOOKUP(LEFT(rc1,4)" & "&2&" &
"RIGHT(rc1,LEN(rc1)-5)," & JobNumber & "keycodes!R1C1:R150C3,3,FALSE)"


Mike
 
Top