LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automate column length wsk Excel Discussion (Misc queries) 1 May 13th 06 12:31 PM
Sum a Column of Variable length Chris G Excel Discussion (Misc queries) 4 November 7th 05 12:25 PM
How to transfer the length of one column to a formula in Visual ba Kanga 85 Excel Programming 5 February 9th 05 01:23 PM
Sum a column of variable length? Brian Excel Discussion (Misc queries) 5 February 3rd 05 02:26 PM
Length of Used Column Alec Excel Programming 2 October 21st 03 03:52 PM


All times are GMT +1. The time now is 02:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"