Macro to copy paste from a different workbook

ljuarez

New Member
Joined
Apr 17, 2014
Messages
4
I have two workbooks. I need to copy a row from workbook A and paste it 17 times on workbook B and repeat this until I've gone through all the rows in workbook A (approximately 480 rows).

Steps:
1) I need to copy A1:E1, A2:E2, A3:E3....A480:E480 from workbook A to workbook B.
2) On workbook B, column F will be the product of E x 17
3) I will need to insert a column after E. This column will have the dates from 9/1/14-1/1/16

This is a sample from workbook A cells A1:E1

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]$2,000.00[/TD]
[/TR]
</tbody>[/TABLE]


I need the output to look like this on workbook B

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]9/1/2014[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]10/1/2014[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]11/1/2014[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]12/1/2014[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]1/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]2/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]3/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]4/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]5/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]6/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]7/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]8/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]9/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]10/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]11/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]12/1/2015[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
[TR]
[TD]651-631F[/TD]
[TD]A631F-CP[/TD]
[TD]A631F-CPMGFEE[/TD]
[TD]651-MGMT FEE[/TD]
[TD]1/1/2016[/TD]
[TD]$2,000.00[/TD]
[TD]$34,000.00[/TD]
[/TR]
</tbody>[/TABLE]






























































I then need the macro to go back to workbook A and copy A2:E2 and copy it 17 times like above, and keep repeating this all the way to row 480 on workbook A.

Right now this is a manual cut and paste process. I have two other workbooks I need to repeat this process on.

Thanks,

Luis
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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