Forum Discussion
AndresAlfT
Mar 13, 2024Copper Contributor
Using Record script in Excel to filter rows in excel across multiple tabs
Hello, Trying to filter multiple sheets based on column A using the record script in the automate tab in Excel. I get the error below. Same error if I test on basic test of a 3x3 table. Also inc...
- Mar 13, 2024
You toggle autofilter on column A, i.e. on the range which has only one column. Next you apply filter to column 1. No such in the range, columns are numbered starting from 0.
Try here to change 1 on 0
sheet1.getAutoFilter().apply(sheet1.getAutoFilter().getRange(), 0, { filterOn: ExcelScript.FilterOn.values, values: ["OK"] });
SergeiBaklan
Mar 13, 2024Diamond Contributor
You toggle autofilter on column A, i.e. on the range which has only one column. Next you apply filter to column 1. No such in the range, columns are numbered starting from 0.
Try here to change 1 on 0
sheet1.getAutoFilter().apply(sheet1.getAutoFilter().getRange(), 0, { filterOn: ExcelScript.FilterOn.values, values: ["OK"] });
- AndresAlfTMar 14, 2024Copper Contributorthank you this works and thank you for the follow up explanation Sergei. Really useful!
- SergeiBaklanMar 14, 2024Diamond Contributor
AndresAlfT , you are welcome