Hi All,
I have been using the following code to Autofill multiple rows at once and have used it multiple times but i am not getting an error
I am needing the code to copy from the last row between columns A to F (Contains formula) as far down as the end of Column G. Column G is always longer as data is pasted into this cell from previous code.
When i run the above it works perfect in that it autofills all columns to the correct row level of G however once its finished i recieve the error appear on screen.
"Run-Time Error '1004':
AutoFill method of Range class failed"
Even if i add other macros linked into it i.e
This full code will run to the end and do what it needs and then the error message will pop up.
Within the spreadsheet i have the same code used a number of times an none give the error.
Any help would be great thanks
Steve
I have been using the following code to Autofill multiple rows at once and have used it multiple times but i am not getting an error
Code:
Dim LastA As Long, LastG As Long
LastA = Range("A" & Rows.Count).End(xlUp).Row
LastG = Range("G" & Rows.Count).End(xlUp).Row
Range("A" & LastA & ":F" & LastA).AutoFill _
Destination:=Range("A" & LastA & ":F" & LastG)
I am needing the code to copy from the last row between columns A to F (Contains formula) as far down as the end of Column G. Column G is always longer as data is pasted into this cell from previous code.
When i run the above it works perfect in that it autofills all columns to the correct row level of G however once its finished i recieve the error appear on screen.
"Run-Time Error '1004':
AutoFill method of Range class failed"
Even if i add other macros linked into it i.e
Code:
Sub AutofillNiacs()
' Autofill formula Niacs
Dim LastA As Long, LastG As Long
LastA = Range("A" & Rows.Count).End(xlUp).Row
LastG = Range("G" & Rows.Count).End(xlUp).Row
Range("A" & LastA & ":F" & LastA).AutoFill _
Destination:=Range("A" & LastA & ":F" & LastG)
Sheets(Array("NiacsDay", "NiacsUpdate")).Select
ActiveWindow.SelectedSheets.Visible = False
NewDateNiacs
End Sub
This full code will run to the end and do what it needs and then the error message will pop up.
Within the spreadsheet i have the same code used a number of times an none give the error.
Any help would be great thanks
Steve