I have the following subroutine, that seemed to be working fine with v8.5, but now seems to be toggling instead of consistantly setting the sort in ascending order. The subroutine is as follows
SUB TableChartSortNumericAscending (SheetName, ObjectName, ColumnNumber)
set Prop = TableChart.GetProperties
if TableChart.GetObjectType=4 then 'Its a Table
Prop.Layout.ColLayouts.Item(ColumnNumber).SortCriteria.SortByNumeric = 1
set vars = Prop.Dimensions
vars.Item(ColumnNumber).SortCriteria.SortByNumeric = 1
It does pretty much as it says: Sets a column in a table or chart to sort numerically in ascending order. Well, it used to. Now when I run it, if the column is currently set to ascending, after running the macro, it will be set to descending. If it was set to discending before running the macro, it will then be set to ascending.
I want this macro to *always* set the column to ascending, regardless what it's currently set to.
What am I doing wrong?