Cut and Move from Row 2 to Final Row

anniemay

Board Regular
Joined
May 31, 2012
Messages
180
I need to cut and move data in a worksheet where the bottom always changes. The header row should stay in worksheet 1 and row 2 down to the bottom needs to be cut and moved to worksheet 2. One time it could be 100 rows and the next time a thousand or more.

Thanks
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi annimay
Didn't know where you wanted it pasted in Sheet 2 so I assumed in row 2
Code:
Sub movem()
Dim lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
Rows("2:" & lr).Cut Destination:=Sheets("Sheet2").Rows("2:2")
End Sub
 
Upvote 0
Hi annimay
Didn't know where you wanted it pasted in Sheet 2 so I assumed in row 2
Code:
Sub movem()
Dim lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
Rows("2:" & lr).Cut Destination:=Sheets("Sheet2").Rows("2:2")
End Sub

Thanks. I did not think to state that. It would be where the last row ends in the worksheet 2, which will also grow each time as that is where the rows are saved.
 
Upvote 0
Try
Code:
Sub movem()
Dim lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
lr2 = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row
Rows("2:" & lr).Cut Destination:=Sheets("Sheet2").Rows(lr2 + 1)
End Sub
 
Upvote 0
Glad it worked, and thanks for the feedback....(y)
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,908
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top