Hello all,
I hope you are well and would like to thank you for the 1000 of times MrExcel has saved me.
If someone knows a macro that could convert some horizontal data I have into vertical data it would save me hours of manual work. Unfortunately, I'm pretty new to creating Macros and have not become this advanced yet. I did find another post similar and tried to copy the macro but continually got the "Subscript out of range" Error.
I need to create this:
[TABLE="width: 517"]
<colgroup><col><col><col span="2"><col span="4"><col span="2"><col span="6"></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]P01[/TD]
[TD]P02[/TD]
[TD]P03[/TD]
[TD]P04[/TD]
[TD]P05[/TD]
[TD]P06[/TD]
[TD]P07[/TD]
[TD]P08[/TD]
[TD]P09[/TD]
[TD]P10[/TD]
[TD]P11[/TD]
[TD]P12[/TD]
[/TR]
[TR]
[TD] Data1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD] 25[/TD]
[TD] 35[/TD]
[TD] 45[/TD]
[TD] 55[/TD]
[TD] 100[/TD]
[TD] 200[/TD]
[TD] 45[/TD]
[TD] 2[/TD]
[TD] 8[/TD]
[TD] 9[/TD]
[TD] 57[/TD]
[TD] 22[/TD]
[/TR]
</tbody>[/TABLE]
Into this:
[TABLE="width: 384"]
<colgroup><col span="6"></colgroup><tbody>[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P1[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P2[/TD]
[TD="align: right"]35[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P3[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P4[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P5[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P6[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P7[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P8[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P9[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P10[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P11[/TD]
[TD="align: right"]57[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P12[/TD]
[TD="align: right"]22[/TD]
[/TR]
</tbody>[/TABLE]
Anything helps!
Cheers,
Michael
I hope you are well and would like to thank you for the 1000 of times MrExcel has saved me.
If someone knows a macro that could convert some horizontal data I have into vertical data it would save me hours of manual work. Unfortunately, I'm pretty new to creating Macros and have not become this advanced yet. I did find another post similar and tried to copy the macro but continually got the "Subscript out of range" Error.
I need to create this:
[TABLE="width: 517"]
<colgroup><col><col><col span="2"><col span="4"><col span="2"><col span="6"></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]P01[/TD]
[TD]P02[/TD]
[TD]P03[/TD]
[TD]P04[/TD]
[TD]P05[/TD]
[TD]P06[/TD]
[TD]P07[/TD]
[TD]P08[/TD]
[TD]P09[/TD]
[TD]P10[/TD]
[TD]P11[/TD]
[TD]P12[/TD]
[/TR]
[TR]
[TD] Data1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD] 25[/TD]
[TD] 35[/TD]
[TD] 45[/TD]
[TD] 55[/TD]
[TD] 100[/TD]
[TD] 200[/TD]
[TD] 45[/TD]
[TD] 2[/TD]
[TD] 8[/TD]
[TD] 9[/TD]
[TD] 57[/TD]
[TD] 22[/TD]
[/TR]
</tbody>[/TABLE]
Into this:
[TABLE="width: 384"]
<colgroup><col span="6"></colgroup><tbody>[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P1[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P2[/TD]
[TD="align: right"]35[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P3[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P4[/TD]
[TD="align: right"]55[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P5[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P6[/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P7[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P8[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P9[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P10[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P11[/TD]
[TD="align: right"]57[/TD]
[/TR]
[TR]
[TD] Data 1 [/TD]
[TD] Data2 [/TD]
[TD]Data3[/TD]
[TD]Data4[/TD]
[TD]P12[/TD]
[TD="align: right"]22[/TD]
[/TR]
</tbody>[/TABLE]
Anything helps!
Cheers,
Michael