# Workbook.applyCellStyle Method

> Workbook.applyCellStyle method in the TX Sheet Control TypeScript API for the browser: Applies a named style to the active-sheet range in one undo operation.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > Workbook > Workbook.applyCellStyle Method
- **407 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/applycellstyle-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/applycellstyle-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/applycellstyle-method/llms-full.txt

---

Applies a named style to the active-sheet range in one undo operation.

Owner: [Workbook](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

### Syntax

```typescript
applyCellStyle(range: string, id: string): void
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `range` | `string` | No | A1 range on the owning worksheet. |
| `id` | `string` | No | Stable identity in the owning document/collection. |

### Return Value

`void`.

### Examples

Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.

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

function applyWorkbookApplyCellStyle(book: Workbook) {
    const workbook = book;

    workbook.applyCellStyle('A1:B1', 'normal');
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [Workbook Class](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/llms-full.txt)
- [Formatting and Number Display](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formatting/llms-full.txt)

---

## Nearby

- **Previous:** [Workbook.analytics Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/analytics-property/llms-full.txt)
- **Next:** [Workbook.autoExpand Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/autoexpand-property/llms-full.txt)
