View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Program an autofill

There are many ways, but they all requiring finding the last filled row (you
have done that already and it appears you find that too cumbersome)

assume the fill is going to be in column D

Dim rng as Range
' get the range from column C
set rng = Range(cells(1,3),cells(1,3).End(xldown))
' go over one column
set rng = rng.offset(0,1)

now rng is the range you want to fill.

--
Regards,
Tom Ogilvy

"Pete K" wrote in message
om...
I want to program an autofill to the end of the rows in a column, but
it won't be the same number of rows each time. When I double click on
the cell tail (small box in lower right corner of highlite cell box)
it fills to the end but in the program it records it to a certain row.
I need it to go to the bottom each time but that bottom will vary
each time.

I figured one way to do it is to have excel count the number of rows,
store it in a variable and fill to that row but I wanted an easier
way. Any suggestions?

Thank you in advance,
Pete K