# SheetValidation Class

> SheetValidation class in the TX Sheet Control TypeScript API for the browser: Sheet-bound validation rules and inspection.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > SheetValidation Class
- **886 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/llms-full.txt

---

Sheet-bound validation rules and inspection. Existing values remain unchanged when a rule is installed.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

ES module import: `import { SheetValidation } from '@txtextcontrol/tx-sheet-control';`.

### Constructor

```typescript
new SheetValidation(sheet: Worksheet): SheetValidation
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `sheet` | `Worksheet` | No | Value matching sheet's declared type and the owning object's validation rules. |

Returns: `SheetValidation`.

### Members

#### Properties

| Property | Description |
|---|---|
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/sheet-property/llms-full.txt) | The sheet value of SheetValidation. |

#### Methods

| Method | Description |
|---|---|
| [check](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/check-method/llms-full.txt) | Checks the current value without modifying the cell or showing a dialog. |
| [choices](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/choices-method/llms-full.txt) | Returns list choices for a cell, including names and range-based lists. |
| [list](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/list-method/llms-full.txt) | Returns detached definitions in their enforcement order. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/remove-method/llms-full.txt) | Removes rules by identity, or all rules when no identity is supplied. |
| [set](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/set-method/llms-full.txt) | Replaces rules on an exact target range; subsequent edits are checked atomically. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```typescript
import type { Workbook } from '@txtextcontrol/tx-sheet-control';

function createSheetValidationReport(book: Workbook) {
    const sheet = book.sheets.at(0);
    sheet.cell('A1').setText('October invoice');
    sheet
        .cell('A1')
        .format({
            fontFamily: 'Liberation Sans',
            fontSize: 16,
            bold: true,
            textColor: '#ffffff',
            fillColor: '#163b63',
        });

    sheet.columns.at(0).setWidth({ pixels: 240 });
    sheet.range('B8:B9').setValues([[120], [80]]);
    sheet.cell('B10').setFormula('=SUM(B8:B9)');
    sheet.range('B8:B10').format({ numberFormatCode: '#,##0.00', fontSize: 11 });
    sheet.validation.set('B8:B9', { type: 'decimal', operator: 'between', formula1: '0', formula2: '10000' });
    return sheet;
}
```

### See Also

- [TypeScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/llms-full.txt)
- [Data Validation](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/validation/llms-full.txt)

---

## In This Section

- [SheetValidation.check Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/check-method/llms-full.txt): SheetValidation.check method in the TX Sheet Control TypeScript API for the browser: Checks the current value without modifying the cell or showing a dialog.
- [SheetValidation.choices Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/choices-method/llms-full.txt): SheetValidation.choices method in the TX Sheet Control TypeScript API for the browser: Returns list choices for a cell, including names and range-based lists.
- [SheetValidation.list Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/list-method/llms-full.txt): SheetValidation.list method in the TX Sheet Control TypeScript API for the browser: Returns detached definitions in their enforcement order.
- [SheetValidation.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/remove-method/llms-full.txt): SheetValidation.remove method in the TX Sheet Control TypeScript API for the browser: Removes rules by identity, or all rules when no identity is supplied.
- [SheetValidation.set Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/set-method/llms-full.txt): SheetValidation.set method in the TX Sheet Control TypeScript API for the browser: Replaces rules on an exact target range.
- [SheetValidation.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/sheet-property/llms-full.txt): SheetValidation.sheet property in the TX Sheet Control TypeScript API for the browser, with its type Worksheet and a TypeScript example.

---

## Nearby

- **Previous:** [SheetProtectionSettings.spinCount Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetprotectionsettings/spincount-property/llms-full.txt)
- **Next:** [SheetValidation.check Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/sheetvalidation/check-method/llms-full.txt)
