Copy paste multiple columns to last row

EAS37

New Member
Joined
Mar 19, 2019
Messages
3
Hello everyone,

Pretty much new here and in VBA. I am working on a internship project that just consumes too much of my time (please dont think I am trying to escape the task which I don't I am just looking for a better and efficient way of doing this monthly routine).

On a monthly basis I get this report that has information across columns . Set up looks like this

[TABLE="width: 1058"]
<colgroup><col><col span="8"></colgroup><tbody>[TR]
[TD]Header[/TD]
[TD]Account information[/TD]
[TD]JAN - DEC[/TD]
[TD]Account information[/TD]
[TD]JAN - DEC[/TD]
[TD]Account information[/TD]
[TD]JAN - DEC[/TD]
[TD]Account information[/TD]
[TD]JAN - DEC[/TD]
[/TR]
[TR]
[TD]Columns[/TD]
[TD]A to G[/TD]
[TD]J to U[/TD]
[TD]X to AD[/TD]
[TD]AE to AP[/TD]
[TD]AS to AY [/TD]
[TD]AZ to BK[/TD]
[TD]BN to BT[/TD]
[TD]BU to CF[/TD]
[/TR]
[TR]
[TD]Number of Columns[/TD]
[TD]7 columns[/TD]
[TD]12 Columns[/TD]
[TD]7 columns[/TD]
[TD]12 Columns[/TD]
[TD]7 columns[/TD]
[TD]12 Columns[/TD]
[TD]7 columns[/TD]
[TD]12 Columns

[/TD]
[/TR]
</tbody>[/TABLE]


I need to prepare the information into another sheet lets call it "dataset" by copying columns A to G twelve times in a column A so that I can copy individual columns J to U data under one column. I will need to do these for all X to AD, AS to AY and BN to BT followed by the JAN- DEC data. The number of rows varies each month but they are the same across the columns each month.

so for example, for simplicity we have 3 rows of information across all columns, I will copy all 3 rows for A to G and paste it in A1 from row 1 to 12 then 13 to 24 then 25 to 36. After this I will copy column J, then the next column to the last cell with information from J till i get to U. Rinse and repeat for the rest of the columns. Its okay when I deal with few hundred rows but becomes tedious when the rows turns in thousands. I am hoping for some assistance where I can incorporate a VBA code to automate this. Any help will be great.

[TABLE="width: 640"]
<colgroup><col width="64" span="10" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]BEFORE[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]JAN[/TD]
[TD="class: xl65, width: 64"]FEB[/TD]
[TD="class: xl65, width: 64"]MAR[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AFTER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]Account information[/TD]
[TD="class: xl65, width: 64"]PERIOD[/TD]
[TD="class: xl65, width: 64"]DATA[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]JAN[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]JAN[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]JAN[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]FEB[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]FEB[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]FEB[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]A[/TD]
[TD]FEB[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]B[/TD]
[TD]FEB[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]C[/TD]
[TD]FEB[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Thank you in advance! :)

EAS
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
TYPO:

AFTER
Account information Account information Account information Account information Account information Account information Account information PERIOD DATA
A A A A A A A JAN 1
B B B B B B B JAN 1
C C C C C C C JAN 1
A A A A A A A FEB 2
B B B B B B B FEB 2
C C C C C C C FEB 2
A A A A A A A MAR 3
B B B B B B B MAR 3
C C C C C C C MAR 3
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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