Sort worksheet rows
xlide_sort_rowsSort Excel range, table, or autofilter rows by column keys, keeping headers and hidden rows in place, then save the workbook.
Instructions
Sorts a range, a table's data rows, or a sheet autofilter's data rows, and saves the workbook. Keys are evaluated in order; each names a column letter for a range or filter, or a header name for a table. A range can keep its first row as a header. Hidden rows keep their places. Formulas, formatting, notes and links move with their rows. This changes existing data order and has no undo in the file: ask the user before calling it. Works on .xlsx, .xlsm and .xlam.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes | Ordered sort keys; each names a column and direction. | |
| sheet | Yes | Worksheet name, matched without case. | |
| header | No | For a range: leave its first row in place. | |
| target | No | range, table or filter. | range |
| file_path | Yes | Absolute path to the Excel file. | |
| cell_range | No | For target='range': block such as A1:D20. | |
| match_case | No | Use case-sensitive text order. | |
| table_name | No | For target='table': table name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||