VBA code to copy and paste row based on certain criteria. need help with Paste part

T0NT0

New Member
Joined
Apr 25, 2013
Messages
4
Dear all,

Currently I have an excel table where I have a macro that based on a certain value in a cell (> 1), it will copy, insert new row and paste the entire row x number of times based on the value in the column "COUNT".

What I need help with is I don't want the row to be copied exactly, but based on the value in "COUNT", for each paste the row will contain only one input value with the following pattern. It's hard to explain, so I hope the table below explains it.

Current macro:
BEFORE
countinputinputinput
3AAA

<tbody>
</tbody>
AFTER
3AAA
3AAA
3AAA
3AAA

<tbody>
</tbody>

what I would like the macro to do:

BEFORE
countinputinputinput
3AAA

<tbody>
</tbody>
AFTER
3AAA
1A
1A
1A

<tbody>
</tbody>



So if the value is 10, I want the macro to copy it 10 times but each row has only one input value if an offset of 1.

Attached is the excel with the current macro and an example how I wish it works.

https://app.box.com/s/s6mcnoclbtvgx0j20xwj

Thank you for your help!

BR,

T0NT0
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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