set_filter
Apply autofilter criteria to an Excel range and hide non-matching rows, using header-based column references with AND logic. Safely backs up and verifies changes.
Instructions
Apply an autofilter over a range whose first row is the header, and actually hide the non-matching rows: an .xlsx stores filter CRITERIA, not hidden state, so criteria (a list of {column, op, value}, ops as in query_range, combined as AND) are evaluated here over cached and literal values; a row whose tested cell holds an uncalculated formula stays visible with a warning. A hazardous workbook refuses unless allow_loss is true. Auto-backup to .ks4xl-backups; atomic verified save. Refuses while open in Excel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| sheet | No | ||
| backup | No | ||
| criteria | No | Autofilter criteria, {column, op, value}, combined as AND. Rows that fail are actually hidden, since .xlsx stores criteria and not state. | |
| location | Yes | ||
| allow_loss | No | ||
| verify_com | No |