Autofill Method of Range Calss Failed
Autofill Method of Range Calss Failed
(OP)
I have the following code snippet, which causes the subject error:
Sheets("Nx=9.0g Fwd").Activate
Range(Cells(LastItemRow, 11), Cells(LastItemRow, 24)).Select
Selection.AutoFill Destination:=Range(Cells(LastItemRow + 1, 11), Cells(LastItemRow + 1, 24)), Type:=xlFillDefault
The odd part is I've lifted this code from another macro which works just fine:
Range(Cells(FirstAttachRow + i - 2, FirstAttachColumn), Cells(FirstAttachRow + i - 2, 100)).Select
Selection.AutoFill Destination:=Range(Cells(FirstAttachRow + i - 2, FirstAttachColumn), Cells(FirstAttachRow + i - 1, 100)), Type:=xlFillDefault
Suggestions? Explanations of why this works in one place and not another would also be useful as I am a VBA novice.
Thanks,
-Turk
Sheets("Nx=9.0g Fwd").Activate
Range(Cells(LastItemRow, 11), Cells(LastItemRow, 24)).Select
Selection.AutoFill Destination:=Range(Cells(LastItemRow + 1, 11), Cells(LastItemRow + 1, 24)), Type:=xlFillDefault
The odd part is I've lifted this code from another macro which works just fine:
Range(Cells(FirstAttachRow + i - 2, FirstAttachColumn), Cells(FirstAttachRow + i - 2, 100)).Select
Selection.AutoFill Destination:=Range(Cells(FirstAttachRow + i - 2, FirstAttachColumn), Cells(FirstAttachRow + i - 1, 100)), Type:=xlFillDefault
Suggestions? Explanations of why this works in one place and not another would also be useful as I am a VBA novice.
Thanks,
-Turk





RE: Autofill Method of Range Calss Failed
Sheets("Nx=9.0g Fwd").Activate
Range(Cells(LastItemRow + 1, 11), Cells(LastItemRow + 1, 24)).FillDown
I'm still lost as to why the original code generated the error.
RE: Autofill Method of Range Calss Failed
CODE
.Activate
.Range(.Cells(LastItemRow, 11), .Cells(LastItemRow, 24)).Select
Selection.AutoFill Destination:=.Range(.Cells(LastItemRow + 1, 11), .Cells(LastItemRow + 1, 24)), Type:=xlFillDefault
End With
HTH
RE: Autofill Method of Range Calss Failed