Hi,
I have the following code that is used to count a variable number or rows of raw data, then extend formulas to the last raw data row in columns M to Q in my spreadsheet.
The error(User/Object defined error) occurs below in the line Selection.AutoFill Destination....etc
Thanks for your help!
I have the following code that is used to count a variable number or rows of raw data, then extend formulas to the last raw data row in columns M to Q in my spreadsheet.
The error(User/Object defined error) occurs below in the line Selection.AutoFill Destination....etc
Thanks for your help!
Code:
Private Sub ExtendFormulas()
Application.Calculation = xlCalculationManual
Dim LastRow1 As Long
LastRow1 = (Range("A" & Rows.Count).End(xlUp).Row) - 1
Range("M2:Q2").Select
Selection.AutoFill Destination:=Range("M3" & ":Q" & LastRow1)
Application.Calculation = xlCalculationAutomatic
End Sub