Vba code to rearrange data

ANTONIO1981

Board Regular
Joined
Apr 21, 2014
Messages
162
Hi All

i have this "table"

in sheet1 starts in cell A1

the mumber of rows will increase substantially as there other costs apart from Postage and courier


[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 309"]
<tbody>[TR]
[TD="class: xl66, width: 309"]OTHER FIXED COSTS TABLE[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"]Jan-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 49"]
<tbody>[TR]
[TD="class: xl66, width: 49"]Feb-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 50"]
<tbody>[TR]
[TD="class: xl66, width: 50"]Mar-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 48"]
<tbody>[TR]
[TD="class: xl66, width: 48"]Apr-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 52"]
<tbody>[TR]
[TD="class: xl66, width: 52"]May-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD="class: xl66, width: 47"]Jun-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD="class: xl66, width: 43"]Jul-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 50"]
<tbody>[TR]
[TD="class: xl66, width: 50"]Aug-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 49"]
<tbody>[TR]
[TD="class: xl66, width: 49"]Sep-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD="class: xl66, width: 47"]Oct-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 51"]
<tbody>[TR]
[TD="class: xl66, width: 51"]Nov-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 49"]
<tbody>[TR]
[TD="class: xl66, width: 49"]Dec-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 309"]
<tbody>[TR]
[TD="class: xl66, width: 309"]Postage and courier[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 46"]
<tbody>[TR]
[TD="class: xl66, width: 46"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



i want to create a new "table" in Sheet 2 starting cell A1
following this style (in the example is only showing to February but i need all the moths obviously)


[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 199"]
<tbody>[TR]
[TD="class: xl66, width: 199"]OTHER FIXED COSTS TABLE[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64"]MONTH[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64"]COST[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 199"]
<tbody>[TR]
[TD="width: 199"]Postage and courier[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64"]Jan-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 199"]
<tbody>[TR]
[TD="width: 199"]Postage and courier[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64"]Feb-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl66, width: 64"] 347 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


thanks in advance

AC
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,223,249
Messages
6,171,031
Members
452,374
Latest member
keccles

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