# Workbook.updateCellStyle Method

> Workbook.updateCellStyle method in the TX Sheet Control TypeScript API for the browser: Updates a named style; affected cells on every sheet inherit the update.

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

---

Updates a named style; affected cells on every sheet inherit the update.

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
updateCellStyle(id: string, patch: Partial<NamedCellStyle>): string
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `id` | `string` | No | Stable identity in the owning document/collection. |
| `patch` | `Partial<NamedCellStyle>` | No | Partial supported settings; unspecified fields are retained. |

### Return Value

`string`.

### 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 demonstrateWorkbookUpdateCellStyle(book: Workbook) {
    const id = book.createCellStyle('Invoice total', { bold: true });
    book.updateCellStyle(id, { formatting: { bold: true, fillColor: '#e5eef4' } });
}
```

### 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)
- [NamedCellStyle Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/namedcellstyle/llms-full.txt)

---

## Nearby

- **Previous:** [Workbook.textToColumns Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/texttocolumns-method/llms-full.txt)
- **Next:** [Workbook.updateConditionalRule Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/updateconditionalrule-method/llms-full.txt)
