# Cell Class

> Cell class in the TX Sheet Control TypeScript API for Node.js, with 18 properties and 23 methods and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > Cell Class
- **1988 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/llms-full.txt

---

A worksheet-bound scalar cell handle. Literal text, entered input and calculated values remain distinct. Cell features are returned as detached snapshots; mutations remain undoable.

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

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

### Constructor

```typescript
new Cell(sheet: Worksheet, ref: string): Cell
```

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

Returns: `Cell`.

### Members

#### Properties

| Property | Description |
|---|---|
| [address](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/address-property/llms-full.txt) | The address value of Cell. |
| [bounds](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/bounds-property/llms-full.txt) | The bounds value of Cell. |
| [cellType](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/celltype-property/llms-full.txt) | The cellType value of Cell. |
| [columnCount](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/columncount-property/llms-full.txt) | The columnCount value of Cell. |
| [comments](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/comments-property/llms-full.txt) | The comments value of Cell. |
| [displayStyle](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/displaystyle-property/llms-full.txt) | The displayStyle value of Cell. |
| [displayText](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/displaytext-property/llms-full.txt) | The displayText value of Cell. |
| [formula](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/formula-property/llms-full.txt) | The formula value of Cell. |
| [hyperlink](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/hyperlink-property/llms-full.txt) | The hyperlink value of Cell. |
| [input](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/input-property/llms-full.txt) | The input value of Cell. |
| [note](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/note-property/llms-full.txt) | The note value of Cell. |
| [picture](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/picture-property/llms-full.txt) | The picture value of Cell. |
| [richText](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/richtext-property/llms-full.txt) | The richText value of Cell. |
| [rowCount](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/rowcount-property/llms-full.txt) | The rowCount value of Cell. |
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/sheet-property/llms-full.txt) | The sheet value of Cell. |
| [style](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/style-property/llms-full.txt) | The style value of Cell. |
| [value](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/value-property/llms-full.txt) | The value value of Cell. |
| [values](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/values-property/llms-full.txt) | The values value of Cell. |

#### Methods

| Method | Description |
|---|---|
| [clear](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/clear-method/llms-full.txt) | Clear content and/or formatting. |
| [copyTo](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/copyto-method/llms-full.txt) | Copy cells within the same workbook using the selected paste mode in one undoable operation. |
| [fillTo](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/fillto-method/llms-full.txt) | The fillTo operation of Cell. |
| [format](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/format-method/llms-full.txt) | Apply a nested/flat style patch to the whole range. |
| [formatText](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/formattext-method/llms-full.txt) | Zero-based UTF-16 offsets, matching JavaScript and .NET string indices. |
| [merge](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/merge-method/llms-full.txt) | Merge the range; across merges each row separately. |
| [read](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/read-method/llms-full.txt) | Read flat address/text/value/display/style records. |
| [removePicture](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/removepicture-method/llms-full.txt) | Remove the embedded cell picture. |
| [setCellType](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setcelltype-method/llms-full.txt) | The setCellType operation of Cell. |
| [setFormula](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setformula-method/llms-full.txt) | Write an explicit formula; leading equals sign is required. |
| [setFormulas](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setformulas-method/llms-full.txt) | Write explicit formulas. |
| [setHyperlink](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/sethyperlink-method/llms-full.txt) | The setHyperlink operation of Cell. |
| [setInput](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setinput-method/llms-full.txt) | Parse entered content like typing in the editor. |
| [setInputs](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setinputs-method/llms-full.txt) | Write entered-content strings. |
| [setNote](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setnote-method/llms-full.txt) | The setNote operation of Cell. |
| [setNoteBounds](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setnotebounds-method/llms-full.txt) | Sets/clears unzoomed note geometry in one undo operation; requires an existing note. |
| [setPicture](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setpicture-method/llms-full.txt) | Embed a PNG/JPEG inside the cell. |
| [setRichText](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setrichtext-method/llms-full.txt) | Write literal text containing independently styled runs. |
| [setText](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/settext-method/llms-full.txt) | Write literal text, preserving leading zeros and leading equals signs. |
| [setValidation](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setvalidation-method/llms-full.txt) | The setValidation operation of Cell. |
| [setValue](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setvalue-method/llms-full.txt) | Write a literal JSON scalar. |
| [setValues](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setvalues-method/llms-full.txt) | Write a typed matrix of matching dimensions. |
| [unmerge](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/unmerge-method/llms-full.txt) | Remove intersecting merges. |

### 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 { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function createCellReport(control: ServerSheetControl) {
    const book = control.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 });

    return sheet;
}
```

### See Also

- [TypeScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)
- [barcode](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/barcode-property/llms-full.txt) — Reads the cell barcode settings, or undefined for a cell without a barcode.
- [setBarcode](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setbarcode-method/llms-full.txt) — Displays a barcode while retaining the underlying value or formula. Omit options to remove only the barcode.

---

## In This Section

- [Cell.address Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/address-property/llms-full.txt): Cell.address property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type string and a TypeScript example.
- [Cell.barcode Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/barcode-property/llms-full.txt): Cell.barcode property in the TX Sheet Control TypeScript API for Node.js: Reads the cell barcode settings, or undefined for a cell without a barcode.
- [Cell.bounds Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/bounds-property/llms-full.txt): Cell.bounds property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type CellRange and a TypeScript example.
- [Cell.cellType Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/celltype-property/llms-full.txt): Cell.cellType property in the TX Sheet Control TypeScript API for Node.js, with its type CellTypeDefinition | undefined and a TypeScript example.
- [Cell.clear Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/clear-method/llms-full.txt): Cell.clear method in the TX Sheet Control TypeScript API for Node.js: Clear content and/or formatting. Includes the syntax and a TypeScript example.
- [Cell.columnCount Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/columncount-property/llms-full.txt): Cell.columnCount property in the TX Sheet Control TypeScript API for Node.js, with its type number and a TypeScript example.
- [Cell.comments Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/comments-property/llms-full.txt): Cell.comments property in the TX Sheet Control TypeScript API for Node.js, with its type CellComments and a TypeScript example.
- [Cell.copyTo Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/copyto-method/llms-full.txt): Cell.copyTo method in the Node.js TypeScript API: Copy cells within the same workbook using the selected paste mode in one undoable operation.
- [Cell.displayStyle Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/displaystyle-property/llms-full.txt): Cell.displayStyle property in the TX Sheet Control TypeScript API for Node.js, with its type CellStyle and a TypeScript example.
- [Cell.displayText Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/displaytext-property/llms-full.txt): Cell.displayText property in the TX Sheet Control TypeScript API for Node.js, with its type string and a TypeScript example.
- [Cell.fillTo Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/fillto-method/llms-full.txt): Cell.fillTo method in the TX Sheet Control TypeScript API for Node.js, with the return type Cell and a TypeScript example.
- [Cell.format Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/format-method/llms-full.txt): Cell.format method in the Node.js TypeScript API: Apply a nested/flat style patch to the whole range. Includes the syntax and a TypeScript example.
- [Cell.formatText Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/formattext-method/llms-full.txt): Cell.formatText method in the TX Sheet Control TypeScript API for Node.js: Zero-based UTF-16 offsets, matching JavaScript and .NET string indices.
- [Cell.formula Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/formula-property/llms-full.txt): Cell.formula property in the TX Sheet Control TypeScript API for Node.js, with its type string | null and a TypeScript example.
- [Cell.hyperlink Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/hyperlink-property/llms-full.txt): Cell.hyperlink property in the TX Sheet Control TypeScript API for Node.js, with its type CellHyperlink | undefined and a TypeScript example.
- [Cell.input Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/input-property/llms-full.txt): Cell.input property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type string and a TypeScript example.
- [Cell.merge Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/merge-method/llms-full.txt): Cell.merge method in the Node.js TypeScript API: Merge the range; across merges each row separately. Includes the syntax and a TypeScript example.
- [Cell.note Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/note-property/llms-full.txt): Cell.note property in the TX Sheet Control TypeScript API for Node.js, with its type CellNote | undefined and a TypeScript example.
- [Cell.picture Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/picture-property/llms-full.txt): Cell.picture property in the TX Sheet Control TypeScript API for Node.js, with its type CellPicture | undefined and a TypeScript example.
- [Cell.read Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/read-method/llms-full.txt): Cell.read method in the Node.js TypeScript API: Read flat address/text/value/display/style records. Includes the syntax and a TypeScript example.
- [Cell.removePicture Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/removepicture-method/llms-full.txt): Cell.removePicture method in the TX Sheet Control TypeScript API for Node.js: Remove the embedded cell picture. Includes the syntax and a TypeScript example.
- [Cell.richText Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/richtext-property/llms-full.txt): Cell.richText property in the TX Sheet Control TypeScript API for Node.js, with its type CellTextRun[] and a TypeScript example.
- [Cell.rowCount Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/rowcount-property/llms-full.txt): Cell.rowCount property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type number and a TypeScript example.
- [Cell.setBarcode Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setbarcode-method/llms-full.txt): Cell.setBarcode method in the Node.js TypeScript API: Displays a barcode while keeping the cell's value or formula; omit options to remove only the barcode.
- [Cell.setCellType Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setcelltype-method/llms-full.txt): Cell.setCellType method in the TX Sheet Control TypeScript API for Node.js, with the return type Cell and a TypeScript example.
- [Cell.setFormula Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setformula-method/llms-full.txt): Cell.setFormula method in the TX Sheet Control TypeScript API for Node.js: Write an explicit formula; leading equals sign is required.
- [Cell.setFormulas Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setformulas-method/llms-full.txt): Cell.setFormulas method in the TX Sheet Control TypeScript API for Node.js: Write explicit formulas. Includes the syntax and a TypeScript example.
- [Cell.setHyperlink Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/sethyperlink-method/llms-full.txt): Cell.setHyperlink method in the TX Sheet Control TypeScript API for Node.js, with the return type Cell and a TypeScript example.
- [Cell.setInput Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setinput-method/llms-full.txt): Cell.setInput method in the Node.js TypeScript API: Parse entered content like typing in the editor. Includes the syntax and a TypeScript example.
- [Cell.setInputs Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setinputs-method/llms-full.txt): Cell.setInputs method in the TX Sheet Control TypeScript API for Node.js: Write entered-content strings. Includes the syntax and a TypeScript example.
- [Cell.setNote Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setnote-method/llms-full.txt): Cell.setNote method in the TX Sheet Control TypeScript API for Node.js, with the return type Cell and a TypeScript example.
- [Cell.setNoteBounds Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setnotebounds-method/llms-full.txt): Cell.setNoteBounds method in the Node.js TypeScript API: Sets/clears unzoomed note geometry in one undo operation; requires an existing note.
- [Cell.setPicture Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setpicture-method/llms-full.txt): Cell.setPicture method in the TX Sheet Control TypeScript API for Node.js: Embed a PNG/JPEG inside the cell. Includes the syntax and a TypeScript example.
- [Cell.setRichText Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setrichtext-method/llms-full.txt): Cell.setRichText method in the TX Sheet Control TypeScript API for Node.js: Write literal text containing independently styled runs.
- [Cell.setText Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/settext-method/llms-full.txt): Cell.setText method in the TX Sheet Control TypeScript API for Node.js: Write literal text, preserving leading zeros and leading equals signs.
- [Cell.setValidation Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setvalidation-method/llms-full.txt): Cell.setValidation method in the TX Sheet Control TypeScript API for Node.js, with the return type Cell and a TypeScript example.
- [Cell.setValue Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setvalue-method/llms-full.txt): Cell.setValue method in the TX Sheet Control TypeScript API for Node.js: Write a literal JSON scalar. Includes the syntax and a TypeScript example.
- [Cell.setValues Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/setvalues-method/llms-full.txt): Cell.setValues method in the Node.js TypeScript API: Write a typed matrix of matching dimensions. Includes the syntax and a TypeScript example.
- [Cell.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/sheet-property/llms-full.txt): Cell.sheet property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type Worksheet and a TypeScript example.
- [Cell.style Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/style-property/llms-full.txt): Cell.style property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type CellStyle and a TypeScript example.
- [Cell.unmerge Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/unmerge-method/llms-full.txt): Cell.unmerge method in the TX Sheet Control TypeScript API for Node.js: Remove intersecting merges. Includes the syntax and a TypeScript example.
- [Cell.value Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/value-property/llms-full.txt): Cell.value property in the TX Sheet Control TypeScript API for Node.js, with its syntax, its type CellValue and a TypeScript example.
- [Cell.values Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/values-property/llms-full.txt): Cell.values property in the TX Sheet Control TypeScript API for Node.js, with its type CellValue[][] and a TypeScript example.

---

## Nearby

- **Previous:** [CalculationEvent.sheetId Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/calculationevent/sheetid-property/llms-full.txt)
- **Next:** [Cell.address Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cell/address-property/llms-full.txt)
