add_condition method

add_condition

Add a format condition.

Returns

Formatting condition object index;

def add_condition(self, type):
    ...
ParameterTypeDescription
typeFormatConditionTypeFormat condition type.

add_condition

Adds a formatting condition.

Returns

Formatting condition object index;

def add_condition(self, type, operator_type, formula1, formula2):
    ...
ParameterTypeDescription
typeFormatConditionTypeThe type of format condition.
operator_typeOperatorTypeThe operator type
formula1strThe value or expression associated with conditional formatting.
If the input value starts with ‘=’, then it will be taken as formula.
Otherwise it will be taken as plain value(text, number, bool).
For text value that starts with ‘=’, user may input it as formula in format: “="=…"”.
formula2strThe value or expression associated with conditional formatting.
The input format is same with formula1

See Also