-
Notifications
You must be signed in to change notification settings - Fork 61
/
excel.sorton.yml
68 lines (58 loc) · 2.14 KB
/
excel.sorton.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
### YamlMime:TSEnum
name: Excel.SortOn
uid: 'excel!Excel.SortOn:enum'
package: excel!
fullName: Excel.SortOn
summary: Represents the part of the cell used as the sorting criteria.
remarks: >-
\[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/30-events/event-column-and-row-sort.yaml
async function sortTopToBottom(criteria: string) {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
const range = sheet.getRange("A1:E5");
// Find the column header that provides the sort criteria.
const header = range.find(criteria, {});
header.load("columnIndex");
await context.sync();
range.sort.apply(
[
{
key: header.columnIndex,
sortOn: Excel.SortOn.value
}
],
false /*matchCase*/,
true /*hasHeaders*/,
Excel.SortOrientation.rows
);
await context.sync();
});
}
```
isPreview: false
isDeprecated: false
fields:
- name: cellColor
uid: 'excel!Excel.SortOn.cellColor:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"CellColor"'
- name: fontColor
uid: 'excel!Excel.SortOn.fontColor:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"FontColor"'
- name: icon
uid: 'excel!Excel.SortOn.icon:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Icon"'
- name: value
uid: 'excel!Excel.SortOn.value:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.2](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Value"'