Help with Macro - copying formula to last line of data based on another column
Hi All,
I posted this thread in the Excel section by mistake instead of this section - can the mods please delete it from there?
I have the below macro that I recorded that copies some formulas I have stored on a sheet and pastes them onto another sheet (there is a reason behind this).
As each time I'll run this macro the number of rows it will need to copy to will vary, what do I need to change in my code in order for it to always copy down to the last row of data (instead of just row 20)? If it could be based on Column A (as there will always be a value in there when the row is populated.
Code:
Sub FormulaImport()
'
' FormulaImport Macro
'
'
Sheets("Formulas").Select
Range("BA2:BZ2").Select
Selection.Copy
Sheets("Master").Select
Range("BA2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("BA2:BZ20")
Range("BA2:BZ20").Select
End Sub
Thanks in advance for any help.
|