Method AddCellValue
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
AddCellValue(XlsxCellRange, XlsxConditionOperator, string, string?, XlsxDifferentialStyle)
Adds a rule that formats cells whose value compares with one or two formulas (Excel's Cell Value).
public XlsxConditionalFormat AddCellValue(XlsxCellRange range, XlsxConditionOperator @operator, string formula1, string? formula2, XlsxDifferentialStyle format)
Parameters
rangeXlsxCellRangeThe cells.
operatorXlsxConditionOperatorThe comparison.
formula1stringA number, a text in double quotes, or a formula, with or without its
=.formula2stringThe upper bound, for Between and NotBetween only.
formatXlsxDifferentialStyleWhat the rule changes.
Returns
- XlsxConditionalFormat
The rule.
Exceptions
- ArgumentNullException
formula1orformatis null, or Between has no second formula.- ArgumentException
A formula is not one Excel reads, or the format sets nothing.
- InvalidOperationException
The sheet is not a worksheet.