Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
---
title: EditSpreadsheet
description: >-
Apply one atomic batch to a native Macro spreadsheet: set cell
values/formulas, format or clear ranges, fill with relative formulas, add
rows, resize columns, add or remove in-cell dropdowns (list data validation
with a clickable arrow, optionally with a color per choice), insert checkboxes
backed by TRUE/FALSE values, convert a range with a header row to a named
table (filterable, sortable, referenced as Table1[Column], with typed columns
such as currency, date, checkbox or dropdown), or add/rename/duplicate/delete
sheets.
---
# EditSpreadsheet
Apply one atomic batch to a native Macro spreadsheet: set cell values/formulas, format or clear ranges, fill with relative formulas, add rows, resize columns, add or remove in-cell dropdowns (list data validation with a clickable arrow, optionally with a color per choice), insert checkboxes backed by TRUE/FALSE values, convert a range with a header row to a named table (filterable, sortable, referenced as Table1[Column], with typed columns such as currency, date, checkbox or dropdown), or add/rename/duplicate/delete sheets. Requires expectedRevision from a fresh ReadSpreadsheet. If the workbook changed, nothing is written: reread and reconsider, never blindly retry. All operations validate before saving; at most 25 operations and 2000 affected cells. Sheet IDs are stable; an exact sheet name may address a sheet added earlier in the same batch. Existing directly referenced sheets cannot be renamed/deleted, and the last sheet cannot be deleted. Read affected ranges after editing to verify computed results. Formula errors are returned as warnings, not silently repaired. Prefer formulas for derived values and keep existing formatting unless asked. Give a column of choices (status, owner, priority) a dropdown with light, distinct choice colors, and a done or yes/no column checkboxes, rather than text or ✓/X. Convert records the user will sort, filter or total into a table. This is the only way to edit a workbook: EditDocument and CSV or plaintext replacement cannot.
## Parameters
| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `documentId` | string | Yes | Native spreadsheet document ID. |
| `expectedRevision` | string | Yes | Exact opaque revision returned by ReadSpreadsheet. |
| `operations` | SpreadsheetOperation[] | Yes | Ordered operations validated and committed together. |