ExcelConditionalFormatsCollectionAddCellValueRule(ExcelConditionalFormatOperator, String, String) Method |
Adds a rule that formats the cells whose value meets a comparison with one or two values, for example between 10 and 20.
Set the font and fill of the cells that meet the condition with the properties of the returned object.
Namespace: ExpertXls.ExcelLibAssembly: expertxls (in expertxls.dll) Version: 10.0.0
Syntaxpublic ExcelConditionalFormat AddCellValueRule(
ExcelConditionalFormatOperator comparisonOperator,
string value1,
string value2
)
Public Function AddCellValueRule (
comparisonOperator As ExcelConditionalFormatOperator,
value1 As String,
value2 As String
) As ExcelConditionalFormat
Parameters
- comparisonOperator ExcelConditionalFormatOperator
- The comparison operator.
- value1 String
- The first value, as an Excel formula without the leading equal sign: a number like "100",
a cell reference like "$H$2" or a text in double quotes like "\"North\"".
- value2 String
- The second value, used by the Between and
NotBetween operators. It can be null for the other operators.
Return Value
ExcelConditionalFormatThe new conditional format rule.
See Also