nparsons75
Well-known Member
- Joined
- Sep 23, 2013
- Messages
- 1,256
- Office Version
- 2016
Hi, is it possible, with a macro, to sort a list in a table and then seperate the list by data in one column.
For example,
[TABLE="width: 500"]
<tbody>[TR]
[TD]MACHINE[/TD]
[TD]ITEM[/TD]
[TD]QTY[/TD]
[TD]DATE[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]CAR[/TD]
[TD]5[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]BUS
[/TD]
[TD]1[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]009[/TD]
[TD]PLANE[/TD]
[TD]2[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]004[/TD]
[TD]BOAT[/TD]
[TD]5[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]SHIP[/TD]
[TD]7[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]BIKE[/TD]
[TD]3[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]009[/TD]
[TD]CYCLE[/TD]
[TD]1[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]004[/TD]
[TD]PLANE[/TD]
[TD]1[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]006[/TD]
[TD]BIKE[/TD]
[TD]9[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]004[/TD]
[TD]SHIP[/TD]
[TD]3[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]006[/TD]
[TD]CAR[/TD]
[TD]4[/TD]
[TD]16/7/17[/TD]
[/TR]
</tbody>[/TABLE]
Taking the data above I would like a button to run a macro that will sort the data by column A and then seperate the list by a dividing row between groups. See example below.
In between each of the grouped items I would need a row that has a colour fill to seperate them visually. Would this even be possible? Thanks in advance.
[TABLE="width: 320"]
<colgroup><col width="80" style="width:60pt" span="4"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 80"][TABLE="width: 320"]
<colgroup><col width="80" style="width:60pt" span="4"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 80"]1[/TD]
[TD="class: xl67, width: 80"]CAR[/TD]
[TD="class: xl67, width: 80"]5[/TD]
[TD="class: xl67, width: 80"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]SHIP[/TD]
[TD="class: xl67"]7[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]2[/TD]
[TD="class: xl67"]BUS[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]2[/TD]
[TD="class: xl67"]BIKE[/TD]
[TD="class: xl67"]3[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]BOAT[/TD]
[TD="class: xl67"]5[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]PLANE[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]SHIP[/TD]
[TD="class: xl67"]3[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]6[/TD]
[TD="class: xl67"]BIKE[/TD]
[TD="class: xl67"]9[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]6[/TD]
[TD="class: xl67"]CAR[/TD]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]9[/TD]
[TD="class: xl67"]PLANE[/TD]
[TD="class: xl67"]2[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]9[/TD]
[TD="class: xl67"]CYCLE[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
For example,
[TABLE="width: 500"]
<tbody>[TR]
[TD]MACHINE[/TD]
[TD]ITEM[/TD]
[TD]QTY[/TD]
[TD]DATE[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]CAR[/TD]
[TD]5[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]BUS
[/TD]
[TD]1[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]009[/TD]
[TD]PLANE[/TD]
[TD]2[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]004[/TD]
[TD]BOAT[/TD]
[TD]5[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]SHIP[/TD]
[TD]7[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]BIKE[/TD]
[TD]3[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]009[/TD]
[TD]CYCLE[/TD]
[TD]1[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]004[/TD]
[TD]PLANE[/TD]
[TD]1[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]006[/TD]
[TD]BIKE[/TD]
[TD]9[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]004[/TD]
[TD]SHIP[/TD]
[TD]3[/TD]
[TD]16/7/17[/TD]
[/TR]
[TR]
[TD]006[/TD]
[TD]CAR[/TD]
[TD]4[/TD]
[TD]16/7/17[/TD]
[/TR]
</tbody>[/TABLE]
Taking the data above I would like a button to run a macro that will sort the data by column A and then seperate the list by a dividing row between groups. See example below.
In between each of the grouped items I would need a row that has a colour fill to seperate them visually. Would this even be possible? Thanks in advance.
[TABLE="width: 320"]
<colgroup><col width="80" style="width:60pt" span="4"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 80"][TABLE="width: 320"]
<colgroup><col width="80" style="width:60pt" span="4"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 80"]1[/TD]
[TD="class: xl67, width: 80"]CAR[/TD]
[TD="class: xl67, width: 80"]5[/TD]
[TD="class: xl67, width: 80"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]SHIP[/TD]
[TD="class: xl67"]7[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]2[/TD]
[TD="class: xl67"]BUS[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]2[/TD]
[TD="class: xl67"]BIKE[/TD]
[TD="class: xl67"]3[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]BOAT[/TD]
[TD="class: xl67"]5[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]PLANE[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]SHIP[/TD]
[TD="class: xl67"]3[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]6[/TD]
[TD="class: xl67"]BIKE[/TD]
[TD="class: xl67"]9[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]6[/TD]
[TD="class: xl67"]CAR[/TD]
[TD="class: xl67"]4[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl81"][/TD]
[/TR]
[TR]
[TD="class: xl67"]9[/TD]
[TD="class: xl67"]PLANE[/TD]
[TD="class: xl67"]2[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
[TR]
[TD="class: xl67"]9[/TD]
[TD="class: xl67"]CYCLE[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl67"]16/07/2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]