HI I am new to VBA world. I am trying to create a macro for my excel sheet. Everything is working fine except I can not use a variable as lookup value in the macro.
When I use my formula as
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-19],[key_kpis.xlsx]Sheet1!C2:C3,2,FALSE)"
it works fine.
But if I try to use the following way, i get an error:
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-J],[key_kpis.xlsx]Sheet1!C2:C3,2,FALSE)"
Basically I want to use a variable as a lookup value rather than a constant value.
New contributor
Umesh Joshi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.