MrExcel Publishing
Your One Stop for Excel Tips & Solutions


Posted by Kamira on January 05, 2001 12:34 AM

Hallo I have an Excelsheet with variable Rowsnumbers
(between 700 Rows and 878 Rows or more)
Row 1 Column a b d and c has a text.
The column d and e are full to end.

I want to fill from row 1 Column a b c and d to
the last row.

Best regards

Posted by Dave on January 05, 2001 12:56 AM

Hi Kamira

This code will autofill columns A,B,C and D with the contents of the first cell in each column down to the last cell with an entry.

Sub AutoFill()
Dim Rw As Long, i As Integer
Dim FillRange As String

For i = 1 To 4
Rw = Cells(65536, i).End(xlUp).Row
FillRange = Cells(1, i).Address & ":" & Cells(Rw, i).Address
Cells(1, i).AutoFill Destination:=Range(FillRange)

End Sub


OzGrid Business Applications