PTSORT01.XLS now contains Jim Wilcox's
( wilcox@SAMAIL.CSNOVELL.MDC.COM )
very cool Sub SetColumnOrderThenSort.

You can download PTSORT.ZIP here. Excel pivot tables have a tendency to lose their initial sort order under a variety of circumstances. This can be real annoying. PTSORT.ZIP (7 Kb) contains the Excel workbook PTSORT01.XLS (79 Kb) which demonstrates how to keep the row and column variable labels of a pivot table sorted in alphabetic order. It also shows how to order the labels in any sequence you wish based on the contents of a spreadsheet range. There's even a routine for randomly shuffling the label order of any pivot table in case you get tired of neat arrangements. Jim Wilcox's Sub is a really creative application of a built-in Excel dialog and illustrates the correct use of Custom Lists for sorting PivotTable objects. Amazing what imaginative people can come up with! Check it out.

Just click HERE to download PTSORT.ZIP.

Unpack with PKUNZIP, open with Excel and enjoy. All the VBA code is right there to read and fool around with.

Click here to email me if you download!

BTW, the following was converted into HTML from PTSORT01.XLS with Microsofts HTML.XLA and, if your browser supports tables, looks something like a pivot table:

ColVarCode
RowVarCode Maybe Missing No Yes Totalt
L 1 1068 0 0 1069 L Yes
B 0 117 0 0 117 B No
D 0 144 0 0 144 D Maybe
K 10 6 5 1 22 K Missing
1 0 1 0 0 1 1
O 3665 5 1527 142 5339 O
S 13 3 5 0 21 S
U 166 0 164 27 357 U
Y 0 394 0 0 394 Y
A 4 767 0 0 771 A
2 0 5 0 0 5 2
Missing 0 71 0 0 71 Missing
Totalt 3859 2581 1701 170 8311
Click here to return to The Fortress.
1