-
Notifications
You must be signed in to change notification settings - Fork 610
excel cfextended
goworm edited this page Jun 26, 2026
·
1 revision
Catch-all conditional-formatting dispatch for CF sub-types that are not exposed by their own --type alias, selected with --prop type=<subtype>.
Path: /{SheetName}/cf[N]
- add - Create an extended CF rule, selecting the sub-type via
--prop type=<subtype> - get - Read back a CF rule's canonical type and style reference
Parent: /{SheetName}
| Property | Required/Default | Description |
|---|---|---|
type |
required | Sub-type selector. One of: belowAverage, containsBlanks, notContainsBlanks, containsErrors, notContainsErrors, contains, notContains, beginsWith, endsWith
|
ref |
Target cell range (aliases: sqref, range), e.g. A1:A100
|
|
text |
Substring for the contains / notContains / beginsWith / endsWith sub-types |
|
fill |
Background fill color (hex RGB) applied via dxf | |
font.color |
Font color (hex RGB) applied via dxf | |
font.bold |
Bold font via dxf (true / false) |
|
stopIfTrue |
Stop evaluating subsequent CF rules when this rule applies (true / false) |
| Attribute | Type | Description |
|---|---|---|
type |
string | Canonical CF rule type token (e.g. dataBar, colorScale, iconSet, formula, topN, cellIs, containsText, aboveAverage, duplicateValues, uniqueValues, timePeriod). Emitted on every CF rule. |
ref |
string | Target cell range |
text |
string | Matched substring (when the sub-type emits it) |
dxfId |
number | Differential format id referencing dxf styles. Emitted only when present on the rule. |
# Highlight blank cells in a range
officecli add data.xlsx /Sheet1 --type cfextended \
--prop type=containsBlanks \
--prop ref=A1:A100 \
--prop fill=FFCCCC
# Highlight cells whose text contains "error" in red bold
officecli add data.xlsx /Sheet1 --type cfextended \
--prop type=contains \
--prop text=error \
--prop ref=B1:B50 \
--prop font.color=FF0000 \
--prop font.bold=true
# Cells beginning with a substring, stopping further rules
officecli add data.xlsx /Sheet1 --type cfextended \
--prop type=beginsWith \
--prop text=PRE \
--prop ref=C1:C100 \
--prop stopIfTrue=true
# Below-average cells
officecli add data.xlsx /Sheet1 --type cfextended \
--prop type=belowAverage \
--prop ref=D1:D100 \
--prop fill=FFCCCC
# Read back a CF rule's canonical type and style id
officecli get data.xlsx /Sheet1/cf[1]- Use
cfextendedonly for sub-types without a dedicated--typealias:belowAverage,containsBlanks,notContainsBlanks,containsErrors,notContainsErrors,contains,notContains,beginsWith,endsWith. - The
typeproperty is required onaddand selects which sub-type rule is created. - The
textproperty applies to thecontains,notContains,beginsWith, andendsWithsub-types. -
fill,font.color, andfont.boldstyle the matched cells through a differential format (dxf). - On
get, thetypeattribute reports the normalized canonical CF type token, anddxfIdis emitted only when the rule references a dxf style.
- Conditional Formatting - Data bars, color scales, icon sets, and formula rules
- Excel Reference - All Excel elements
Based on OfficeCLI v1.0.119