Skip to content

applycxf

Apply conditional formatting to a range.

applycxf(cr, cf_type, params, prop1, val1, ...)

Applies a conditional-formatting rule to cr. cf_type is the rule type — 'Equality', 'BeginsWith', 'EndsWith', 'ContainsText', 'NotContainsText', 'Ranking', 'TimePeriod', 'ColorMap', 'DataBar', 'IconSet', etc. The params argument is a string with rule-specific data, followed by optional name-value pairs for the differential style applied when the rule matches.

The abbreviation cxf = conditional cellXf (conditional formatting record).

applycxf(A1:A100, 'ContainsText', 'TODO', 'BackgroundColor', '#FFE699')
applycxf(B1:B100, 'Ranking', 'Top', 'BackgroundColor', '#90EE90')
  • applyxf — Apply a cell style (named or property-pair) to a range.
  • removecxf — Remove all conditional formatting from a range.