Sorting Element (Microsoft Excel)

Contains the sorting specifications and sort options used in the most recent sort.

Contained In

XML

Subelements

AlternateMethod, CaseSensitive, Descending, LeftToRight, Order, Sort

Remarks

One to three Sort subelements are required, but all other subelements are optional. If a range is sorted in descending order, then the Descending element is specified immediately after the corresponding Sort element.

Examples

This example sorts a range by the ZIP Code column in ascending order, followed by the Currency column in descending order, and then by the Name column in ascending order. The sort is case-sensitive and the data is sorted left-to-right by column. The normal sorting method is used.


 <x:Sorting>
  <x:Sort>ZIP Code</x:Sort>
  <x:Sort>Currency</x:Sort>
  <x:Descending/>
  <x:Sort>Name</x:Sort>
  <x:LeftToRight/>
  <x:CaseSensitive/>
 </x:Sorting>

This example sorts a range by the Month column in ascending order according to the third built-in list. The sort is not case-sensitive and the data is sorted left-to-right by column. The alternate sorting method is used.


 <x:Sorting>
  <x:Sort>Month</x:Sort>
  <x:LeftToRight/>
  <x:AlternateMethod/>
  <x:Order>3</x:Order>
 </x:Sorting>