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
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