MMM,
Or ... do you mean simply that you want to sort the result table according to a Key Figure?
If sorting is what you want, this can be accomplished manually by selecting the Key Figure, right-clicking, and selecting Sort (Ascending or Descending).
Or, it can be accomplished automatically as in the following example:
Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
'select the total inventory column and
On Error Resume Next
Application.Goto Reference:=resultArea
Selection.Find(What:="Total Inventory", After:=ActiveCell, MatchCase:=True).Select
If Right(ActiveCell, 12) = "Cycle (Klbs)" Then
'sort in decending order
Run "SAPBEX.XLA!SAPBEXfireCommand", "SODV", Selection
End If
End Sub
Add a comment