# Angular Spreadsheet Cell Comments

The Kendo UI for Angular Spreadsheet allows you to display a comment for each cell. Cell comments are annotations that provide additional context or notes about the data without modifying the cell value.

When a comment is added, the cell is marked with a red triangle in the top-right corner and hovering over the cell displays the comment in a tooltip. When you export the Spreadsheet to Excel, cell comments are preserved as native [Excel cell comments](https://support.microsoft.com/en-us/office/insert-comments-and-notes-in-excel-bdcc9f5d-38e2-45b4-9a92-0b2b5c7bf6f8).

The following example shows a Q1 Budget Spreadsheet with comments set on cells **C3** and **C6** during initialization. Use the toggle button to add or remove a comment on cell **C4** at runtime.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/spreadsheet/cell-comments/source.txt)

## Defining Cell Comments

To define a comment for a cell upon the initialization of the Spreadsheet, pass the desired content to the `comment` property of a [`Cell`](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/cell) object in the [`sheets`](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/spreadsheetcomponent#sheets) configuration.

```typescript
public sheets: SheetDescriptor[] = [{
    name: 'Invoice',
    rows: [{
        cells: [
            { value: 216321, comment: 'Last updated by the warehouse team on 2025-01-15.' },
        ]
    }]
}];
```

## Managing Cell Comments Dynamically

You can add, update, or remove comments at runtime by accessing the active sheet through the [`SpreadsheetWidget`](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/spreadsheetwidget) instance of the [`SpreadsheetComponent`](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/spreadsheetcomponent) and calling the `comment()` method of the [`Range`](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/range) object.

The `comment()` method supports the following usage patterns:

* Passing a string value to set or update a comment.
* Passing `null` to remove an existing comment.
* Calling the method with no arguments to read the current value—it returns the comment text, or `null` when no comment is present.

```ts
@ViewChild('spreadsheet') public spreadsheetRef!: SpreadsheetComponent;

public toggleComment(): void {
    const sheet = this.spreadsheetRef.spreadsheetWidget.activeSheet();
    const range = sheet.range('A2');
    const current = range.comment();

    if (current === null) {
        range.comment('Comment added to cell A2');
    } else {
        range.comment(null);
    }
}
```

## See Also

* [Data Binding](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/data-binding)
* [Toolbar Tools](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/tools)
* [API Reference of the Cell](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/cell)
* [API Reference of the Range](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/range)
* [API Reference of the SpreadsheetWidget](https://www.telerik.com/kendo-angular-ui/components/spreadsheet/api/spreadsheetwidget)
