Hi
Would someone be able to help why this doesn't work?
I'm importing data into first empty row in cells A:P and then autofill the formulas from R:V. However I get the following error:
Excel VBA Runtime Error 1004 - "Autofill Method of Range Class Failed”
Any help would be great.
Thanks
Would someone be able to help why this doesn't work?
VBA Code:
Sub Macro5()
'
' Macro5 Macro
'
Dim LR As Long, LR2 As Long, LR3 As Long, code As String
Sheets("Core Data").Select
LR = Range("B" & Rows.Count).End(xlUp).Row
LR2 = Range("R" & Rows.Count).End(xlUp).Row
LR3 = (Range("R" & Rows.Count).End(xlUp).Row) + 1
code = "R" & LR3 & ":V" & LR
Range("R" & LR2 & ":V" & LR2).Select
Range("V" & LR2).Activate
Selection.AutoFill Destination:=Range(code), Type:=xlFillDefault
Range(code).Select
End Sub
I'm importing data into first empty row in cells A:P and then autofill the formulas from R:V. However I get the following error:
Excel VBA Runtime Error 1004 - "Autofill Method of Range Class Failed”
Any help would be great.
Thanks