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

# DataValidation

## Overview

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

Represents data validation settings for a range of cells.

This class declares 6 methods for DataValidation objects in Python programs.
Available methods include: `__init__`, `__repr__`, `add`, `copy`, `delete`, `modify`.
Public members are accessible to any Python application after installing the Aspose.Cells FOSS for Python package.
Properties: `alert_style`, `allow_blank`, `error`, `error_message`, `error_title`, `formula1`, and 17 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `sqref` | - | Read/Write | Gets or sets the cell range(s) for this validation. |
| `ranges` | - | Read | Gets the cell range(s) as a list. |
| `type` | - | Read/Write | Gets or sets the validation type. |
| `operator` | - | Read/Write | Gets or sets the comparison operator. |
| `formula1` | - | Read/Write | Gets or sets the first formula for validation. |
| `formula2` | - | Read/Write | Gets or sets the second formula for validation. |
| `alert_style` | - | Read/Write | Gets or sets the style of the error alert. |
| `show_error_message` | - | Read/Write | Gets or sets whether to show the error alert when invalid data is entered. |
| `show_error` | - | Read/Write | Alias for show_error_message (Excel VBA compatibility). |
| `error_title` | - | Read/Write | Gets or sets the title of the error alert dialog. |
| `error_message` | - | Read/Write | Gets or sets the error message displayed when invalid data is entered. |
| `error` | - | Read/Write | Alias for error_message (ECMA-376 compatibility). |
| `show_input_message` | - | Read/Write | Gets or sets whether to show the input message when the cell is selected. |
| `show_input` | - | Read/Write | Alias for show_input_message (Excel VBA compatibility). |
| `input_title` | - | Read/Write | Gets or sets the title of the input message dialog. |
| `prompt_title` | - | Read/Write | Alias for input_title (ECMA-376 compatibility). |
| `input_message` | - | Read/Write | Gets or sets the input message displayed when the cell is selected. |
| `prompt` | - | Read/Write | Alias for input_message (ECMA-376 compatibility). |
| `allow_blank` | - | Read/Write | Gets or sets whether blank/empty entries are valid. |
| `ignore_blank` | - | Read/Write | Alias for allow_blank (Excel VBA compatibility). |
| `show_dropdown` | - | Read/Write | Gets or sets whether to show the dropdown arrow for list validation. |
| `in_cell_dropdown` | - | Read/Write | Alias for show_dropdown (Excel VBA compatibility). |
| `ime_mode` | - | Read/Write | Gets or sets the IME (Input Method Editor) mode. |

## Methods

| Signature | Description |
|-----------|-------------|
| `__init__(sqref)` | Initializes a new DataValidation instance. |
| `add(validation_type, alert_style, operator, formula1, formula2)` | Configures the data validation with the specified parameters. |
| `modify(validation_type, alert_style, operator, formula1, formula2)` | Modifies the data validation settings. |
| `delete()` | Clears the validation settings (resets to no validation). |
| `copy()` | Creates a copy of this DataValidation. |
| `__repr__()` | Returns a string representation of the validation. |

## See Also

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