write_range
Writes values, formulas, and number formats into a specified range in a live workbook, overwriting existing cell content.
Instructions
Write values and/or formulas into a range of the live workbook. Accepts a 2D array (rows x columns) or a single scalar that fills the whole range. Formulas are set separately from values. Also supports setting the number format. Content in the target range is overwritten.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | A1 range address, e.g. "A1:C10". | |
| values | No | 2D array of values, or a single scalar broadcast across the range. | |
| formulas | No | 2D array of formula strings (e.g. "=SUM(A1:A10)"), or a single formula broadcast across the range. | |
| sheetName | No | Worksheet name. Defaults to the active worksheet. | |
| workbookId | No | Target workbook ID from list_workbooks. Optional when only one workbook is connected. | |
| numberFormat | No | Number format string (e.g. "0.00", "#,##0", "dd/mm/yyyy"), 2D array or single broadcast. |