Rotating_Potato
New Member
- Joined
- Oct 9, 2015
- Messages
- 8
Hello,
Desperately in the need of the advise of the forum's experts. I have a code:
The above produces an error 1004 of range class failed. Tried multiple variations of the code, but in the essence followed same logic.
The goal that I want to achieve: find the last cell in column "R", then find the last cell in that row. Finally, select the range and autofill up to the row below the last row. Hopefully this explains what I want... Struggling with it already for hours...Please help.
Desperately in the need of the advise of the forum's experts. I have a code:
Code:
Sub autofill()
Workbooks(file_main).Worksheets("sheet1").Activate
ActiveSheet.Range("R52").End(xlDown).Select
ActiveSheet.Range(Selection, Selection.End(xlToLeft)).Select
Selection.autofill Destination:=ActiveSheet.Range(Range("R52").End(xlUp).Offset(-1, 0), Range("HH52").End(xlDown)), Type:=xlFillDefault
End Sub
The above produces an error 1004 of range class failed. Tried multiple variations of the code, but in the essence followed same logic.
The goal that I want to achieve: find the last cell in column "R", then find the last cell in that row. Finally, select the range and autofill up to the row below the last row. Hopefully this explains what I want... Struggling with it already for hours...Please help.