Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to column length into a formula
I have the following code which works well:
Sheets("Outcomes").Select Range("J2").Select ActiveCell.FormulaR1C1 = _"=VLOOKUP(RC[-8],'Paste-AB'!R1C1:R100C2,2)" With ActiveSheet lastrowo = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("J2").AutoFill Destination:=.Range("J2:J" & lastrowo), _Type:=xlFillDefault End With However I arbitary chose the value 100 in the third row, and I would like to change this to 'lastrowp' which I have determined elsewhere. ActiveCell.FormulaR1C1 = _"=VLOOKUP(RC[-8],'Paste-AB'!R1C1:R&"lastrowp"C2,2)" doesn't work, and neither does: ActiveCell.FormulaR1C1 = _"=VLOOKUP(RC[-8],'Paste-AB'!R1C1:R&(lastrowp)C2,2)". Help! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automate column length | Excel Discussion (Misc queries) | |||
Sum a Column of Variable length | Excel Discussion (Misc queries) | |||
How to transfer the length of one column to a formula in Visual ba | Excel Programming | |||
Sum a column of variable length? | Excel Discussion (Misc queries) | |||
Length of Used Column | Excel Programming |