I apologize in advance if the title is not very clear
Basically i need a VBA code that transforms Data from below shown "Table Given" to "Table Result"
Thus for example, since there are 3 doors which have sales of mentioned items
The items are copy pasted above each other 3 times, and the name of the door is pasted next to each sales
Please note that the number of doors might increase and the item number might increase
Thank you in advanced
Table Given
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 64, align: center"]Item[/TD]
[TD="class: xl67, width: 64, align: center"]Door A[/TD]
[TD="class: xl67, width: 64, align: center"]Door B[/TD]
[TD="class: xl67, width: 64, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]2[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]3[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]3[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]1[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]2[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]4[/TD]
[/TR]
</tbody>[/TABLE]
Table Result
[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width: 48pt; text-align: center;"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 64, align: center"]Item[/TD]
[TD="class: xl67, width: 64, align: center"]Sales[/TD]
[TD="class: xl67, width: 64, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
</tbody>[/TABLE]
Basically i need a VBA code that transforms Data from below shown "Table Given" to "Table Result"
Thus for example, since there are 3 doors which have sales of mentioned items
The items are copy pasted above each other 3 times, and the name of the door is pasted next to each sales
Please note that the number of doors might increase and the item number might increase
Thank you in advanced
Table Given
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 64, align: center"]Item[/TD]
[TD="class: xl67, width: 64, align: center"]Door A[/TD]
[TD="class: xl67, width: 64, align: center"]Door B[/TD]
[TD="class: xl67, width: 64, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]2[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]3[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]3[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]1[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]2[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]4[/TD]
[/TR]
</tbody>[/TABLE]
Table Result
[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width: 48pt; text-align: center;"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 64, align: center"]Item[/TD]
[TD="class: xl67, width: 64, align: center"]Sales[/TD]
[TD="class: xl67, width: 64, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door A[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door B[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 1[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 2[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 3[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 5[/TD]
[TD="class: xl67, align: center"]3[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 6[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 7[/TD]
[TD="class: xl67, align: center"]2[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
[TR]
[TD="class: xl67, align: center"]Item 8[/TD]
[TD="class: xl67, align: center"]4[/TD]
[TD="class: xl67, align: center"]Door C[/TD]
[/TR]
</tbody>[/TABLE]