Macro fill down formula

M

Marc Knowles

I have set up a macro to do a series of calculations automatically in
spreadsheets with various numbers of records. The macro uses the 'fill down'
command to apply the formulae to all records. What is the simplest way to
stop the fill down at the last record? I set up my macro using the 'record'
function in excel.

Thanks
 
G

Gord Dibben

Marc

Enter a formula in C1 then run this macro.

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet.UsedRange
Lrow = .Cells(.Cells.Count).Row
Range("C1:C" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP
 
Top