VB Insert Coppied rows - VB Loop?

dcolella15

New Member
Joined
Oct 28, 2015
Messages
11
Here is a screenshot of my workbook.

http://my.jetscreenshot.com/20092/20160209-nszp-274kb

What I am doing now is a manual process. I am copying the above Highlighted rows and then "Inserting Copied rows" under each row that is labeled "original row" to generate the required data in rows 1-23 referencing the columns to the left.

I'm not great with <acronym title="vBulletin" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VB</acronym>, but this process is so "repetitive" that there must be script to eliminate the manual nature of this.

I used the macro creator to Copy the required cells, but the insert function under the required rows has me at a loss. (See Below)

Code:
Sub Copy_insert_Rows()'
' Copy_insert_Rows Macro
' Copy_insert_Rows - for revenue re-class
'
' Keyboard Shortcut: Ctrl+r
'
    Rows("3:25").Select
    Selection.Copy
End Sub

Any help would be great!



Thanks in advance!!

DC
 
if you were wanting to insert them into row 2 you would use:
Code:
Rows("2:2").Insert Shift:=xlDown
if it's a different row, then adjust the code to suit :)
 
Upvote 0
Thanks for the response dermie_72. Thanks for the above code! I will give this a shot. I need to get this to loop over and over again as well, so the "row to insert under" will be dynamic. After I insert the copied cells under 51 the subsequent row would be 51+24 and so on.
 
Upvote 0
you could set a value before the row.
IE.
Code:
rownum = 51
start of loop
copy your range
rows(rownum & ":" & rownum).insert shift:=xldown
rownum = ruwnum + 24
repeat loop
 
Upvote 0
if you need additional assistance with this issue, please send a private message as I am no longer following this thread
 
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