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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top