Hi Everyone,
I have a table of two columns, one column for dates and the other column with duplicates items.
I was wondering if there is a macro to arrange the 1st column by dates, and the second column with no consecutive duplicates (i.e. as much as possible as sometimes there is no way to avoid consecutive duplicates).
I am sure this can be done but I just can't figure it out.
Below is a "before and after" tables showing what I am trying to achieve, in case I wasn't clear about it. Thanks for helping out.
[TABLE="width: 474"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Before[/TD]
[TD][/TD]
[TD][/TD]
[TD]After[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[TD][/TD]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[TD][/TD]
[TD]2 jan 2019[/TD]
[TD]e[/TD]
[/TR]
[TR]
[TD]2 jan 2019[/TD]
[TD]e[/TD]
[TD][/TD]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]3 jan 2019[/TD]
[TD]f[/TD]
[TD][/TD]
[TD]3 jan 2019[/TD]
[TD]f[/TD]
[/TR]
[TR]
[TD]3 jan 2019[/TD]
[TD]f[/TD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
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
cheers,
ryuryuryu
I have a table of two columns, one column for dates and the other column with duplicates items.
I was wondering if there is a macro to arrange the 1st column by dates, and the second column with no consecutive duplicates (i.e. as much as possible as sometimes there is no way to avoid consecutive duplicates).
I am sure this can be done but I just can't figure it out.
Below is a "before and after" tables showing what I am trying to achieve, in case I wasn't clear about it. Thanks for helping out.
[TABLE="width: 474"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Before[/TD]
[TD][/TD]
[TD][/TD]
[TD]After[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[TD][/TD]
[TD]1 jan 2019[/TD]
[TD]b[/TD]
[/TR]
[TR]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[TD][/TD]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[TD][/TD]
[TD]2 jan 2019[/TD]
[TD]e[/TD]
[/TR]
[TR]
[TD]2 jan 2019[/TD]
[TD]e[/TD]
[TD][/TD]
[TD]2 jan 2019[/TD]
[TD]d[/TD]
[/TR]
[TR]
[TD]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