View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
chris[_6_] chris[_6_] is offline
external usenet poster
 
Posts: 3
Default Autofill last row?

Ron,

That did it. Works perfect. Thank you so much.
One more question. Is there a way to do it if there is an empty colum? For
example, if I wanted to have columns D and G empty for visual reasons.

"Ron de Bruin" wrote in message
...
Hi Cris

Use this then

Set rng1 = Sheets("Sheet1").Cells(9, a).End(xlDown)


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"chris" wrote in message

...
Ron,

Thank you so much for your reply. That solution works great.

Unfortunately
it doesn't quite work for what I need because of something I forgot to
mention. The top few cells in some of the columns are empty. The first

row
that is completely full is row 9. From there down, all cell are used.

Is
there any way to get it to look at A9 through I9 as the starting point?
Thanks again.

Chris


"Ron de Bruin" wrote in message
...
Try this

Sub filldownrow()
Dim rng1 As Range
For a = 1 To 9
Set rng1 = Sheets("Sheet1").Cells(1, a).End(xlDown)
rng1.AutoFill _
Destination:=Range(rng1, _
rng1.Offset(1, 0)), _
Type:=xlFillDefault
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"chris" wrote in message

...
With the help of this newsgroup I was able to write the following

macro
to
autofill the last cell in column A down one row:

Sub filldownrow()
Dim rng1 As Range
Set rng1 = Sheets("Totals").Range("A1").End(xlDown)
rng1.AutoFill _
Destination:=Range(rng1, _
rng1.Offset(1, 0)), _
Type:=xlFillDefault
End Sub

Now I need to do the same thing but for the entire last row (or

columns
A
through I to be exact.) I know I could just run 9 different macros,

but
would prefer just one. Any help would be greatly appreciated.

Chris