FormatConditionCollection
Source: aspose.
Represents conditional formatting. The FormatConditions can contain up to three conditional formats.
Methods
Methods
add(cellArea, type, operatorType, formula1, formula2) → Array of Number
Adds a formatting condition and effected cell rang to the FormatConditions The FormatConditions can contain up to three conditional formats. References to the other sheets are not allowed in the formulas of conditional formatting. OperatorType
Parameters
Name | Type | Optional | Description |
---|---|---|---|
cellArea |
|
Conditional formatted cell range. |
|
type |
Number |
|
FormatConditionType |
operatorType |
Number |
|
OperatorType |
formula1 |
String |
|
The value or expression associated with conditional formatting. |
formula2 |
String |
|
The value or expression associated with conditional formatting |
- Returns
-
Array of Number
[0]:Formatting condition object index;[1] Effected cell rang index.
addArea(cellArea) → Number
Adds a conditional formatted cell range.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
cellArea |
|
Conditional formatted cell range. |
- Returns
-
Number
Conditional formatted cell rang index.
addCondition(type, operatorType, formula1, formula2) → Number
Adds a formatting condition.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
type |
Number |
|
FormatConditionType |
operatorType |
Number |
|
OperatorType |
formula1 |
String |
|
The value or expression associated with conditional formatting. If the input value starts with '=', then it will be taken as formula. Otherwise it will be taken as plain value(text, number, bool). For text value that starts with '=', user may input it as formula in format: "="=..."". |
formula2 |
String |
|
The value or expression associated with conditional formatting. The input format is same with formula1 |
- Returns
-
Number
Formatting condition object index;
addCondition(type) → Number
Add a format condition.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
type |
Number |
|
FormatConditionType |
- Returns
-
Number
Formatting condition object index;
get(index) → FormatCondition
Gets the formatting condition by index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
index |
Number |
|
the index of the formatting condition to return. |
- Returns
-
FormatCondition
the formatting condition
getCellArea(index) → CellArea
Gets the conditional formatted cell range by index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
index |
Number |
|
the index of the conditional formatted cell range. |
- Returns
-
CellArea
the conditional formatted cell range
getCount()
Gets the count of the conditions.
getRangeCount()
Gets count of conditionally formatted ranges.
removeArea(index)
Removes conditional formatted cell range by index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
index |
Number |
|
The index of the conditional formatted cell range to be removed. |
removeArea(startRow, startColumn, totalRows, totalColumns) → boolean
Remove conditional formatting int the range.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
startRow |
Number |
|
The startRow of the range. |
startColumn |
Number |
|
The startColumn of the range. |
totalRows |
Number |
|
The number of rows of the range. |
totalColumns |
Number |
|
The number of columns of the range. |
- Returns
-
boolean
Returns TRUE, this FormatCondtionCollection should be removed.
removeCondition(index)
Removes the formatting condition by index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
index |
Number |
|
The index of the formatting condition to be removed. |