Copy and paste Rows

King_leopard

New Member
Joined
Oct 7, 2014
Messages
3
I'm trying to create a macro to cut a row with multiple columns and paste it one row above. Next I copy values from this recently pasted row (columns A-G only) and paste it in a blank row which was created from the above action.
This code works for only one row but I need to highlight different rows and paste them in the same manner. My Question is how do I have the row selection criteria to change with whatever I'm selecting so it can be cut and paste as mentioned below but just the rows I'm selecting?


Rows("1530:1530").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Rows("1531:1531").Select
Selection.Cut
Rows("1530:1530").Select
ActiveSheet.Paste
Range("A1530:G1530").Select
Selection.Copy
Range("A1531").Select
ActiveSheet.Paste
End Sub

Thank you,

 
Maybe:

Code:
Sub King_leopard()
Rows(ActiveCell.Row).Insert
Rows(ActiveCell.Row + 1).Cut Rows(ActiveCell.Row)
Range(Cells(ActiveCell.Row, "A"), Cells(ActiveCell.Row, "G")).Copy Cells(ActiveCell.Row + 1, "A")
End Sub
 
Upvote 0
Maybe:

Code:
Sub King_leopard()
Rows(ActiveCell.Row).Insert
Rows(ActiveCell.Row + 1).Cut Rows(ActiveCell.Row)
Range(Cells(ActiveCell.Row, "A"), Cells(ActiveCell.Row, "G")).Copy Cells(ActiveCell.Row + 1, "A")
End Sub

Exactly what I needed! Thank you!
 
Upvote 0

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