-
-
Notifications
You must be signed in to change notification settings - Fork 39
addAutofilter
Julian Halliwell edited this page May 21, 2025
·
6 revisions
Adds dropdown autofilters to the specified range of cells.
addAutofilter( workbook[, cellRange, row ] )
-
workbook
spreadsheet object
-
cellRange
string: the cell range reference where the filters should appear in the form "A1:Z1" -
row
numeric default=1: ifcellRange
is missing or empty, apply the autofilters to this entire row
Chainable? Yes.
- Autofilters are UI controls allowing the user to only show rows where the column contains the chosen value.
- You set them on columns in one row only, normally the first.
- If you don't specify a cell range or row, the autofilters will be applied to all columns in the first row.
- The
cellRange
argument overrides anyrow
specified. - Ranges containing multiple rows will ignore all but the first specified row.
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget" ] ] )
workbook = spreadsheet.workbookFromQuery( data )
spreadsheet.addAutofilter( workbook ) //apply to all columns in the first row
workbook2 = spreadsheet.workbookFromQuery( data )
spreadsheet.addAutofilter( workbook2, "A1" ) //apply just to the first column