openpyxl.formatting.formatting module

class openpyxl.formatting.formatting.ConditionalFormatting(sqref=(), pivot=None, cfRule=(), extLst=None)[source]

Bases: Serialisable

cells

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

cfRule

A sequence (list or tuple) that may only contain objects of the declared type

pivot

Values must be of type <class ‘bool’>

rules

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

sqref

Values must be of type <class ‘openpyxl.worksheet.cell_range.MultiCellRange’>

tagname = 'conditionalFormatting'
class openpyxl.formatting.formatting.ConditionalFormattingList[source]

Bases: object

Conditional formatting rules.

add(range_string, cfRule)[source]

Add a rule such as ColorScaleRule, FormulaRule or CellIsRule

The priority will be added automatically.