Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells(ActiveCell.Row + 0, 6).FormulaR1C1 = "=VLOOKUP(RC[-4];'Sheet2'!
A:D;3;FALSE)" doesn't work. How do you relatively refer to a cell within a function? RC[-4] should be replaced. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm not sure I fully understand what you mean but maybe this Cells(ActiveCell.Row + 0, 6).FormulaR1C1 = "=VLOOKUP(RC[-4],Sheet2!R[-15]C[-6]:R[14]C[-3],3,FALSE)" Note that I've used , instead of ; for my version of Excel so change these back. Mike " wrote: Cells(ActiveCell.Row + 0, 6).FormulaR1C1 = "=VLOOKUP(RC[-4];'Sheet2'! A:D;3;FALSE)" doesn't work. How do you relatively refer to a cell within a function? RC[-4] should be replaced. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. RC[-4] did actually work, the problem wasn't there.
But why does Excel add ( and ) around L? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm pleased that worked but I don't understand what you mean by But why does Excel add ( and ) around L? Mike " wrote: Thanks. RC[-4] did actually work, the problem wasn't there. But why does Excel add ( and ) around L? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cells(ActiveCell.Row, 6).FormulaR1C1 = "=VLOOKUP(RC[-4],'Sheet2'!C1:C4,3,FALSE)
VBA is USA centric--use commas, not semicolons. And 'Sheet2'!A:D wasn't in R1C1 reference style. wrote: Cells(ActiveCell.Row + 0, 6).FormulaR1C1 = "=VLOOKUP(RC[-4];'Sheet2'! A:D;3;FALSE)" doesn't work. How do you relatively refer to a cell within a function? RC[-4] should be replaced. -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm pleased that worked but I don't understand what you mean by But why does Excel add ( and ) around L? When I go to the cell that the macro affected, the function bar shows parentheses around the L, which indicates column. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Relative cell value in function | Excel Programming | |||
Using the drag down function and formula referring to other worksh | Excel Discussion (Misc queries) | |||
Referring to Cells in a forumula using a function | Excel Worksheet Functions | |||
Referring to function in another workbook | Excel Worksheet Functions | |||
SUMIF function referring to values on different Worksheet | Excel Worksheet Functions |