Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's a couple of errors the
- first you're setting FormulaR1C1 but not providing an R1C1 format formula (you're actually using a mix of R1C1 & A1 content. it would probably work but it could cause you problems later. - secondly your string handling is broken. I'd be suprised if the VBA editor let you use it at all. Here's the code you meant to write... ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-7], R10C" & VarX & ":R113C" & VarY & ", 2, FALSE)" "miek" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I make a blank cell in a formula cell with a range of cell | Excel Discussion (Misc queries) | |||
Subtract cell formula from existing cell formula | Excel Programming | |||
get the value of a formula in cell B1 into cell A1 without changing my current cell selection | Excel Programming | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) | |||
Question: Cell formula or macro to write result of one cell to another cell | Excel Programming |