---
Product: Aspose.Cells
Platform: python
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/python/conditionalformatcollection
---

# ConditionalFormatCollection

## Overview

`ConditionalFormatCollection` is a class in Aspose.Cells FOSS for Python.

Represents a collection of conditional formats for a worksheet.

This class declares 8 methods for ConditionalFormatCollection objects in Python programs.
Available methods include: `__init__`, `__iter__`, `__len__`, `add`, `clear`, `get_by_index`, `get_by_range`, `remove`.
Public members are accessible to any Python application after installing the Aspose.Cells FOSS for Python package.
Properties: `count`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `count` | - | Read | Gets the number of conditional formats in the collection. |

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__()` | Initializes a new instance of ConditionalFormatCollection class. |
| `add()` | Adds a new conditional format to the collection. |
| `get_by_index(index)` | Gets a conditional format by its index. |
| `get_by_range(range_str)` | Gets a conditional format by its range. |
| `remove(cf)` | Removes a conditional format from the collection. |
| `clear()` | Clears all conditional formats from the collection. |
| `__iter__()` | Iterates over all conditional formats in the collection. |
| `__len__()` | Gets the number of conditional formats in the collection. |

## See Also

- [Aspose.Cells for Python — Enterprise API Reference](https://reference.aspose.com/cells/python-java/)