automatic autofill


Posted by Steve on July 02, 2001 9:30 PM

Here is my problem:

I have a set of 7 contiguous horizontal cells in columns C through I (for example, C48:I48) that I need to autofill down 1 row. The columns are fixed but the row numbers may change. If the cells are already selected, how do I write a macro to autofill the 7 cells directly below them?

Thanks in advance for any help.

Steve

Posted by Ivan F Moala on July 03, 2001 1:00 AM

Steve....one way to do this is with your
range selected....run this macro.

Sub AutoFill_Down1()

Dim Rg As Range
Dim SRg As String
Dim LRg As String

Set Rg = Selection
SRg = Rg.Item(1).Address
LRg = Rg.Item(Rg.Count).Offset(1, 0).Address

Selection.AutoFill Destination:=Range(SRg & ":" & LRg)

Set Rg = Nothing

End Sub

Ivan



Posted by Steve on July 05, 2001 4:08 PM

Thanks Ivan,
Worked like a charm.

Steve