Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Check with this.
set dimension = chart.GetProperties.Dimensions
msgbox dimension(0).SortCriteria.SortByAscii
If it shows 1 then sort done by asc. -1 means Desc.0 means sort is not done by Text(ABC).
For numeric use SortByNumeric instead of SortByAscii.
Celambarasan
Celambarasan:
While this retrieves the default sort order, it doesn't retrieve the current sorted order. For example, using the code at the bottom of this message, values for 8 columns are retrieved with column 3 selected for sorting, as:
3, 1, 2, 4, 5, 6, 7, 8
What I would like to be returned is:
3 desc, 1 asc, 2 asc, 4 asc, 5 asc, 6 asc, 7 asc, 8 asc
The default sort order for all columns is asc, which is what .SortCriteria.SortByAscii returns. However, if the user elects to sort it a different way through the interface (right click on column, select Sort) it overrides the default sort order. It's that value I'm looking for.
Are there any extensions off of the array -- something like cols(i).GetSortDirection?
Also, thanks for your help.
Richard
set chart = ActiveDocument.GetSheetObject("CH117")
cols = chart.GetProperties.TableProperties.InterFieldSortOrder
for i = lbound(cols) to ubound(cols)
if i < ubound(cols) Then
output = output & cols(i)+1 & ", "
Else
output = output & cols(i)+1
End if
next
msgbox output