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: 1
Default Need to insert formula to a variable number of rows

I am trying to copy a vlookup formula, using vba, down colum "U" to
rows that vary in length every time a do this report (newCount is the
variable amount of Rows). The main problem with my code is the first
argument in the vlookup formula. It has to be in relative mode down
colum "E" starting in row 2; hence x=count +1, X being the row in colum
"E". Can some one help. Here is my code.

Sub fillRange()
Range("u2").Select
Dim Count As Integer
Dim newCount As Integer
Dim fCount As Integer
newCount = 215
For Count = 1 To newCount
x = Count + 1
ActiveCell.Offset(Count - 1, 0) = "=VLookup($e&(x),'Program
Lookup' _ !A2:L500, 5, False)"
Next Count
End Sub

Thanks

 
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
Applying formula to variable number of rows Shikha Excel Worksheet Functions 5 March 3rd 09 02:32 PM
Insert Variable Number of Rows; With Loop ryguy7272 Excel Worksheet Functions 2 December 27th 06 08:25 PM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM
insert variable number of rows tina Excel Programming 1 February 9th 05 01:18 PM
Insert rows in depending on criteria in variable columns jeffbert Excel Programming 2 October 4th 04 06:53 PM


All times are GMT +1. The time now is 07:16 PM.

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"