sort_range
Sorts a worksheet range by one or more columns using zero-based offsets, with optional header preservation and ascending or descending order.
Instructions
Sort a range by one or more columns. Fields are given as zero-based column offsets within the range.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | A1 range address to sort, e.g. "A2:D100" (include or exclude headers as needed). | |
| fields | Yes | Sort fields, applied in order. | |
| sheetName | No | Worksheet name. Defaults to the active worksheet. | |
| hasHeaders | No | True if the first row is a header row that should not be sorted. Default false. | |
| workbookId | No | Target workbook ID from list_workbooks. Optional when only one workbook is connected. |