Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ExcelScript.SortMethod enum
- Package:
- ExcelScript
Represents the ordering method to be used when sorting Chinese characters.
Remarks
Used by
Examples
/**
* This script sorts a range using the values in the first column.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the range (A1:D8) to sort from the current worksheet.
const worksheet = workbook.getActiveWorksheet();
const rangeToSort = worksheet.getRange("A1:D8");
// Create a SortField for text sorting.
let valueSort: ExcelScript.SortField = {
ascending: true,
key: 0, /* First column */
sortOn: ExcelScript.SortOn.value
};
// Apply the SortField to the range.
rangeToSort.getSort().apply(
[valueSort],
false, /* Don't let casing have an impact of sorting. */
true, /* The range has headers. */
ExcelScript.SortOrientation.rows,
ExcelScript.SortMethod.pinYin /* Use phonetic sorting for Chinese characters. */
);
}
Fields
| pinYin |
| strokeCount |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Scripts
Feedback
Was this page helpful?
