ashkankord
New Member
- Joined
- May 9, 2013
- Messages
- 6
Hi folks,
I am having some trouble executing some VBA, I am trying to find the last row on sheet one and then select 100 rows from the last row up and copy, however I am getting run time error 1004 application defined or object defined error;
I appreciate some help here;
here is my code:
Sub copyrows()
Dim findlastrow As Integer
Worksheets("sheet1").Select
findlastrow = Range("a1").End(xlDown).Row
Dim y As Integer
y = findlastrow - 100
Rows(findlastrow, y).Select
End Sub
I am having some trouble executing some VBA, I am trying to find the last row on sheet one and then select 100 rows from the last row up and copy, however I am getting run time error 1004 application defined or object defined error;
I appreciate some help here;
here is my code:
Sub copyrows()
Dim findlastrow As Integer
Worksheets("sheet1").Select
findlastrow = Range("a1").End(xlDown).Row
Dim y As Integer
y = findlastrow - 100
Rows(findlastrow, y).Select
End Sub