Need a Macro to cut selected row and row underneath it and paste to sheet 2

dmills41

New Member
Joined
Oct 11, 2013
Messages
1
Hello,
after fooling around with coding for awhile I have realized that I need to get an Excel Macro book to understand all of this. I have realized that just "hitting the record button" doesnt work. you have to actually know how to code in order to get your macro to do exactly what you want.

I need a macro for a report I do once a month. Lets see if I can explain.

I need a macro to:

1. select any row that I want, cut this row and the row immediately under it.
2. paste these rows in the "next empy row" in "sheet 2"
3. go back to sheet 1 and delete the 2 rows that I just "cut"

Im not going to paste my macro that I built, that doesnt work. I would rather see someones raw take on this based on my description above.

any help is GREATLY appreciated! thanks in advance!

David
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try this: Put your cursor anywhere in the row on sheet1 where you want to move the row data and the row under it to sheet2. Then run this macro:
Sub dmills41()
ActiveCell.Rows("1:2").EntireRow.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Selection.Delete Shift:=xlUp
End Sub
 
Last edited:
Upvote 0
It is assumee that you will assign this macro to a button or keyboard shortcut so that when you manually make a selection, you then click the buton or use the shortcut to get the other actions to take place.
Code:
Sub cpyNpst()
Dim rng As Range
Set rng = Sheets(1).Range("A" & Selection.Row).Resize(2, Columns.Count)
rng.Cut Sheets(2).Cells(Rows.Count, 1).End(xlUp)(2)
Selection.Resize(2, 1).EntireRow.Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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