Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anybody have any macro code that will allow me to detect the current column on a straight table that is sorted, and in what direction (ascending/descending) that its sorted by?
Nigel,
Part I - the sorted column.
Hth,
Thilo
PS: I tool the code from the API Guide Sample for 'InterFieldSortOrder' ... which has a slight bug in lbound and ubound.
Sub SortInfo
set chart = ActiveDocument.GetSheetObject("CH01")
cols = chart.GetProperties.TableProperties.InterFieldSortOrder
msgbox "Sorted Column = " & CStr(cols(lbound(cols))+1)
end sub
' Modified Sample from API Guide
sub SI
set chart = ActiveDocument.GetSheetObject("CH01")
cols = chart.GetProperties.TableProperties.InterFieldSortOrder
for i = lbound(cols) to ubound(cols)
msgbox("sort priority " & i+1 & " for column " & cols(i)+1 )
next
end sub