View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
miek miek is offline
external usenet poster
 
Posts: 39
Default cell ref in a formula

I have the following formula that works
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7], R2C10:R683C11, 2, FALSE)"

but I would like to use dymanic varaibles. However the below does not work
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7], $J$&"varX":$K$ & "varY", 2, FALSE)"

could someone help with the syntax
Thanks