# Workbook.removeDuplicates Method

> Workbook.removeDuplicates method in the TX Sheet Control TypeScript API for the browser: Removes duplicates in the selected 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.removeDuplicates Method
- **495 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/removeduplicates-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/removeduplicates-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/workbook/removeduplicates-method/llms-full.txt

---

Removes duplicates in the selected 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
removeDuplicates(range: string, options?: RemoveDuplicatesOptions): RemoveDuplicatesPreview
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `range` | `string` | No | A1 range on the owning worksheet. |
| `options` | `RemoveDuplicatesOptions \| undefined` | Yes | Supported settings for this operation; omitted settings retain documented defaults. |

### Return Value

`RemoveDuplicatesPreview`.

### 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 applyWorkbookRemoveDuplicates(book: Workbook) {
    const workbook = book;

    const result = workbook.removeDuplicates('A1:B5', { columns: [0], hasHeaders: true });
    return result;
}
```

### 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)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)
- [RemoveDuplicatesOptions Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/removeduplicatesoptions/llms-full.txt)
- [RemoveDuplicatesPreview Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/removeduplicatespreview/llms-full.txt)

---

## Nearby

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