Skip to content

excel duplicatevalues

goworm edited this page Jun 26, 2026 · 1 revision

Excel: Duplicate Values

A conditional-formatting rule that highlights duplicate values within a cell range.

Path: /{SheetName}/cf[N]

Operations

  • add - Create a duplicate-values rule on a range with a differential format
  • get - Read back the rule's attributes

add

Parent: /{SheetName}

Properties

Property Required/Default Description
ref yes Target cell range. Aliases: sqref, range (e.g., A1:A100)
fill Background fill color via dxf
font.color Font color via dxf
font.bold Bold via dxf
stopIfTrue Stop evaluating subsequent CF rules when this rule applies

get Attributes

Attribute Type Description
ref string Target cell range
type string Canonical CF rule type token (e.g. duplicateValues). Emitted on every CF rule
dxfId number Differential format id referencing dxf styles. Emitted only when present on the rule

Examples

# Highlight duplicate values in A1:A100 with a light-red fill
officecli add data.xlsx /Sheet1 --type duplicatevalues \
  --prop ref=A1:A100 \
  --prop fill=FFCCCC

# Duplicate-values rule with a red, bold font
officecli add data.xlsx /Sheet1 --type duplicatevalues \
  --prop ref=A1:A100 \
  --prop font.color=FF0000 \
  --prop font.bold=true

# Stop evaluating further CF rules once this one matches
officecli add data.xlsx /Sheet1 --type duplicatevalues \
  --prop ref=A1:A100 \
  --prop fill=FFCCCC \
  --prop stopIfTrue=true

# Read back a rule
officecli get data.xlsx /Sheet1/cf[1]

Notes

  • The rule highlights cells whose values are duplicated elsewhere in the target range.
  • The fill, font.color, and font.bold properties are applied through a differential format (dxf); on read-back the rule exposes its dxfId only when one is present.
  • ref accepts the aliases sqref and range.

See Also


Based on OfficeCLI v1.0.119

Clone this wiki locally