-
Notifications
You must be signed in to change notification settings - Fork 61
/
excel.datavalidationoperator.yml
95 lines (82 loc) · 3.53 KB
/
excel.datavalidationoperator.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
### YamlMime:TSEnum
name: Excel.DataValidationOperator
uid: 'excel!Excel.DataValidationOperator:enum'
package: excel!
fullName: Excel.DataValidationOperator
summary: Represents the data validation operator enum.
remarks: >-
\[ [API set: ExcelApi 1.8](/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/22-data-validation/data-validation.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Decision");
const rankingRange = sheet.tables.getItem("NameOptionsTable").columns.getItem("Ranking").getDataBodyRange();
// When you are developing, it is a good practice to
// clear the dataValidation object with each run of your code.
rankingRange.dataValidation.clear();
let greaterThanZeroRule = {
wholeNumber: {
formula1: 0,
operator: Excel.DataValidationOperator.greaterThan
}
};
rankingRange.dataValidation.rule = greaterThanZeroRule;
rankingRange.dataValidation.prompt = {
message: "Please enter a positive number.",
showPrompt: true,
title: "Positive numbers only."
};
rankingRange.dataValidation.errorAlert = {
message: "Sorry, only positive numbers are allowed",
showAlert: true,
style: "Stop",
title: "Negative Number Entered"
};
await context.sync();
});
```
isPreview: false
isDeprecated: false
fields:
- name: between
uid: 'excel!Excel.DataValidationOperator.between:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Between"'
- name: equalTo
uid: 'excel!Excel.DataValidationOperator.equalTo:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"EqualTo"'
- name: greaterThan
uid: 'excel!Excel.DataValidationOperator.greaterThan:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"GreaterThan"'
- name: greaterThanOrEqualTo
uid: 'excel!Excel.DataValidationOperator.greaterThanOrEqualTo:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"GreaterThanOrEqualTo"'
- name: lessThan
uid: 'excel!Excel.DataValidationOperator.lessThan:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LessThan"'
- name: lessThanOrEqualTo
uid: 'excel!Excel.DataValidationOperator.lessThanOrEqualTo:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LessThanOrEqualTo"'
- name: notBetween
uid: 'excel!Excel.DataValidationOperator.notBetween:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"NotBetween"'
- name: notEqualTo
uid: 'excel!Excel.DataValidationOperator.notEqualTo:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"NotEqualTo"'