Syntax 1: Uses East Asian sorting methods to sort the range, or uses the method for the active region if the range contains only one cell. For example, Japanese sorts in the order of the Kana syllabary.
Syntax 2: Uses East Asian sorting methods to sort a PivotTable report. For example, Japanese sorts in the order of the Kana syllabary. For more information, see the argument list.
Syntax 1
expression.SortSpecial(SortMethod, Key1, Order1, Key2, Type, Order2, Key3, Order3, Header, OrderCustom, MatchCase, Orientation)
Syntax 2
expression.SortSpecial(SortMethod, Key1, Order1, Type, OrderCustom, Orientation)
expression Required. An expression that returns a Range object.
SortMethod Optional Variant. Specifies how the range is to be sorted. Can be one of the following XlSortMethod constants: xlPinYin or xlStroke. These constants may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
Key1 Optional Variant. The first sort field, as either text (a PivotTable field or range name) or a Range object ("Dept" or Cells(1, 1)
, for example).
Order1 Optional Variant. Can be one of the following XlSortOrder constants: xlAscending or xlDescending. Use xlAscending to sort Key1 in ascending order. Use xlDescending to sort Key1 in descending order. The default constant is xlAscending.
Key2 Optional Variant. The second sort field, as either text (a PivotTable field or range name) or a Range object. If you omit this argument, there's no second sort field. Don’t use this argument when sorting PivotTable reports.
Type Optional Variant. Specifies which elements are to be sorted. Can be one of the following XlSortType constants: xlSortLabels or xlSortValues. Use this argument only when sorting PivotTable reports.
Order2 Optional Variant. Can be one of the following XlSortOrder constants: xlAscending or xlDescending. Use xlAscending to sort Key2 in ascending order. Use xlDescending to sort Key2 in descending order. The default constant is xlAscending. Don’t use this argument when sorting PivotTable reports.
Key3 Optional Variant. The third sort field, as either text (a range name) or a Range object. If you omit this argument, there's no third sort field. Don’t use this argument when sorting PivotTable reports.
Order3 Optional Variant. Can be one of the following XlSortOrder constants: xlAscending or xlDescending. Use xlAscending to sort Key3 in ascending order. Use xlDescending to sort Key3 in descending order. The default constant is xlAscending. Don’t use this argument when sorting PivotTable reports.
Header Optional Variant. Specifies whether the first row contains headers. Can be one of the following XlYesNoGuess constants: xlYes, xlNo, or xlGuess. Use xlYes if the first row contains headers (it shouldn't be sorted). Use xlNo if there are no headers (the entire range should be sorted). Use xlGuess to let Microsoft Excel determine whether there's a header, and to determine where it is, if there is one. The default constant is xlNo. Not used when sorting PivotTable reports.
OrderCustom Optional Variant. This argument is a 1-based integer offset into the list of custom sort orders. If you omit OrderCustom, 1 (Normal) is used.
MatchCase Optional Variant. True to do a case-sensitive sort; False to do a sort that's not case sensitive. Don’t use this argument when sorting PivotTable reports.
Orientation Optional Variant. If this argument is either set to xlTopToBottom or omitted, the sort is done from top to bottom (by row). If it’s set to xlLeftToRight, the sort is done from left to right (by column).