VBA to copy "N" rows and insert above copied rows

Dan88

Active Member
Joined
Feb 14, 2008
Messages
275
Office Version
  1. 365
Platform
  1. Windows
Hello, i have to do this manual copy and paste existing data daily and update the date to today.
Is there a VBA that can ask me how many rows to copy within range and paste it above the copied data?

For instance i need to copy A11:K11 daily and insert above the copied data so the newest date will always show on A11.

i've tried this but it wont do what i need it to.. any help would be greatly appreciated.

Sub copy()
'Get Row number from user
myRow = Application.InputBox _
("Please Enter A Row Number For The Insertion", _
"Row Number Input", Type:=1)
'Quit if Cancelled
If myRow = False Then Exit Sub
'Copy Range on ActiveSheet
ActiveSheet.Rows("2:11").Copy
'Insert at Row entered by user
Rows(myRow).Insert


End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Bump. Hi community, can any please offer some assistance or pointers to my code above?

Thanks
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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