使用Google App脚本从过滤数据中删除一行
我已经在我的数据中添加了使用应用脚本的过滤器&我试图仅删除过滤数据,但似乎我的功能忽略了过滤器。 例如,如果我有10行数据&过滤后,有2行,我的功能将删除原始数据的第一行&不完全是过滤的2行。
如果我尝试使用 - “ getDatarange()。getDisPlayValues();”在过滤的纸张中,它仍然显示表格的完整数据。但是,当我将其复制到另一张纸上时,仅复制过滤的行。
我正在尝试找出一种删除过滤行的方法,而无需将数据移至任何其他表格。
I have added a filter using app scripts to my data & I was trying to delete ONLY the filtered data, but seems like my function is ignoring the filters.
For example if I have 10 rows of data & after filtering out, there are 2 rows, my function will delete the 1st two rows of the original data & not exactly the filtered 2 rows.
If I try to use - "getDataRange().getDisplayvalues();" in the filtered sheet, it still shows complete data of the sheet. But when I copy it to another sheet, only filtered rows are copied.
I am trying to figure out a way to delete the filtered rows without moving the data to any other sheet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
函数
sheet.isrowhiddendybyfilter
告诉您是否不被过滤器隐藏。您可以循环浏览整个范围,以获取所有不隐藏的行,就像这样:The function
sheet.isRowHiddenByFilter
tells you whether or not a row is hidden by a filter. You can loop through the range to get all non-hidden rows, like so: