Hi, I would appreciate any help on how to write some code to sort groups of cells I have into numerical order. The cells are grouped like this:
[TABLE="class: outer_border, width: 200"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]16[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]green[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: center"]triangle[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD="align: center"]blue[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD="align: center"]square[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]21[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD="align: center"]yellow[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD="align: center"]diamond[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD="align: center"]red[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD="align: center"]circle[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
The numbers are start and end times so I would like to sort the cells by the first number in each group (cells A1, A5, A9, A13 in my example) so the result should be this:
[TABLE="class: outer_border, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]red[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: center"]circle[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD="align: center"]blue[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD="align: center"]square[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]16[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD="align: center"]green[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD="align: center"]triangle[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]21[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD="align: center"]yellow[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD="align: center"]diamond[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
I'm new to coding so really not sure the best way of doing it. The groups of cells are all named ranges if that makes it simpler? Many thanks!
[TABLE="class: outer_border, width: 200"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]16[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]green[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: center"]triangle[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD="align: center"]blue[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD="align: center"]square[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]21[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD="align: center"]yellow[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD="align: center"]diamond[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD="align: center"]red[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD="align: center"]circle[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
The numbers are start and end times so I would like to sort the cells by the first number in each group (cells A1, A5, A9, A13 in my example) so the result should be this:
[TABLE="class: outer_border, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD="align: center"]red[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD="align: center"]circle[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]12[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD="align: center"]blue[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD="align: center"]square[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]16[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD="align: center"]green[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD="align: center"]triangle[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]21[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD="align: center"]yellow[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD="align: center"]diamond[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
I'm new to coding so really not sure the best way of doing it. The groups of cells are all named ranges if that makes it simpler? Many thanks!