Macro for Copying & Pasting in Bulk & Filling Series

AFlyingHippo

New Member
Joined
Jul 15, 2013
Messages
1
Hi All,

I have a worksheet that has data in 52 rows (starting at row 2) and 4 columns (A, B, C, and D). Currently column A is unique to itself, and Columns B, C, D go together. Excluding headers, each column has the following number of cells with data:
Column A has 52 cells
Column B has 40 cells
Column C has 40 cells
Column D has 40 cells - 1 unique cell

I need a macro that will make 40 copies of all 52 cells in Column A, and pair them with the cells in column B, C, and D

Example:


<colgroup><col style="width:48pt" span="4" width="64"> </colgroup><tbody>
[TD="class: xl65, width: 64"][TABLE="width: 256"]
<colgroup><col style="width:48pt" span="4" width="64"> </colgroup><tbody>[TR]
[TD="class: xl66, width: 64"]Name
[/TD]
[TD="class: xl66, width: 64"]Country[/TD]
[TD="class: xl66, width: 64"]City[/TD]
[TD="class: xl66, width: 64"]Constant[/TD]

[TD="class: xl67"]Alex[/TD]
[TD="class: xl67"]United Kingdom[/TD]
[TD="class: xl67"]London[/TD]
[TD="class: xl67"]Yes[/TD]

[TD="class: xl67"]Brian[/TD]
[TD="class: xl67"]China[/TD]
[TD="class: xl67"]Beijing[/TD]
[TD="class: xl67"]Yes[/TD]

[TD="class: xl67"]Calvin[/TD]
[TD="class: xl67"]United States[/TD]
[TD="class: xl67"]Miami[/TD]
[TD="class: xl67"]Yes[/TD]

[TD="class: xl67"]David[/TD]
[TD="class: xl67"]United States[/TD]
[TD="class: xl67"]Chicago[/TD]
[TD="class: xl67"]Yes[/TD]

[TD="class: xl67"] [/TD]
[TD="class: xl67"]Japan[/TD]
[TD="class: xl67"]Tokyo[/TD]
[TD="class: xl67"]Yes[/TD]

[TD="class: xl67"] [/TD]
[TD="class: xl67"]United Kingdom[/TD]
[TD="class: xl67"]Leeds[/TD]
[TD="class: xl67"]Yes[/TD]

[TD="class: xl67"] [/TD]
[TD="class: xl67"]Germany[/TD]
[TD="class: xl67"]Berlin[/TD]
[TD="class: xl67"]Yes
[/TD]

[TD="class: xl67"]
[/TD]
[TD="class: xl67"]France[/TD]
[TD="class: xl67"]Paris[/TD]
[TD="class: xl67"]Yes
[/TD]

</tbody>
[/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Becomes:

[TABLE="width: 300"]
<colgroup><col><col><col span="2"></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]Country[/TD]
[TD]City[/TD]
[TD]Constant[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]United Kingdom[/TD]
[TD]London[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]China[/TD]
[TD]Beijing[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]United States[/TD]
[TD]Miami[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]United States[/TD]
[TD]Chicago[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Japan[/TD]
[TD]Tokyo[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]United Kingdom[/TD]
[TD]Leeds[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]Germany[/TD]
[TD]Berlin[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]France[/TD]
[TD]Paris[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]United Kingdom[/TD]
[TD]London[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]China[/TD]
[TD]Beijing[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]United States[/TD]
[TD]Miami[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]United States[/TD]
[TD]Chicago[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Japan[/TD]
[TD]Tokyo[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]United Kingdom[/TD]
[TD]Leeds[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]Germany[/TD]
[TD]Berlin[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]France[/TD]
[TD]Paris[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]United Kingdom[/TD]
[TD]London[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]China[/TD]
[TD]Beijing[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]United States[/TD]
[TD]Miami[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]United States[/TD]
[TD]Chicago[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Japan[/TD]
[TD]Tokyo[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]United Kingdom[/TD]
[TD]Leeds[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]Germany[/TD]
[TD]Berlin[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]France[/TD]
[TD]Paris[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]United Kingdom[/TD]
[TD]London[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]China[/TD]
[TD]Beijing[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]United States[/TD]
[TD]Miami[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]United States[/TD]
[TD]Chicago[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Japan[/TD]
[TD]Tokyo[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]United Kingdom[/TD]
[TD]Leeds[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]Germany[/TD]
[TD]Berlin[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]France[/TD]
[TD]Paris[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]United Kingdom[/TD]
[TD]London[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]China[/TD]
[TD]Beijing[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]United States[/TD]
[TD]Miami[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]United States[/TD]
[TD]Chicago[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Japan[/TD]
[TD]Tokyo[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Brian[/TD]
[TD]United Kingdom[/TD]
[TD]Leeds[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Calvin[/TD]
[TD]Germany[/TD]
[TD]Berlin[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]David[/TD]
[TD]France[/TD]
[TD]Paris[/TD]
[TD]Yes[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thank you for your help.
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

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,229
Messages
6,170,881
Members
452,364
Latest member
springate

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