/
excel.conditionalcellvaluerule.yml
99 lines (81 loc) · 3.5 KB
/
excel.conditionalcellvaluerule.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
96
97
98
99
### YamlMime:TSType
name: Excel.ConditionalCellValueRule
uid: 'excel!Excel.ConditionalCellValueRule:interface'
package: excel!
fullName: Excel.ConditionalCellValueRule
summary: Represents a cell value conditional format rule.
remarks: '\[ [API set: ExcelApi 1.6](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: interface
properties:
- name: formula1
uid: 'excel!Excel.ConditionalCellValueRule#formula1:member'
package: excel!
fullName: formula1
summary: 'The formula, if required, on which to evaluate the conditional format rule.'
remarks: >-
\[ [API set: ExcelApi 1.6](/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/14-conditional-formatting/conditional-formatting-basic.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
const range = sheet.getRange("B21:E23");
const conditionalFormat = range.conditionalFormats
.add(Excel.ConditionalFormatType.cellValue);
conditionalFormat.cellValue.format.font.color = "red";
conditionalFormat.cellValue.rule = { formula1: "=0", operator: "LessThan" };
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'formula1: string;'
return:
type: string
- name: formula2
uid: 'excel!Excel.ConditionalCellValueRule#formula2:member'
package: excel!
fullName: formula2
summary: 'The formula, if required, on which to evaluate the conditional format rule.'
remarks: '\[ [API set: ExcelApi 1.6](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'formula2?: string;'
return:
type: string
- name: operator
uid: 'excel!Excel.ConditionalCellValueRule#operator:member'
package: excel!
fullName: operator
summary: The operator of the cell value conditional format.
remarks: >-
\[ [API set: ExcelApi 1.6](/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/14-conditional-formatting/conditional-formatting-basic.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
const range = sheet.getRange("B21:E23");
const conditionalFormat = range.conditionalFormats
.add(Excel.ConditionalFormatType.cellValue);
conditionalFormat.cellValue.format.font.color = "red";
conditionalFormat.cellValue.rule = { formula1: "=0", operator: "LessThan" };
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: >-
operator: Excel.ConditionalCellValueOperator | "Invalid" | "Between" | "NotBetween" | "EqualTo" | "NotEqualTo" |
"GreaterThan" | "LessThan" | "GreaterThanOrEqual" | "LessThanOrEqual";
return:
type: >-
<xref uid="excel!Excel.ConditionalCellValueOperator:enum" /> | "Invalid" | "Between" | "NotBetween" |
"EqualTo" | "NotEqualTo" | "GreaterThan" | "LessThan" | "GreaterThanOrEqual" | "LessThanOrEqual"