包含公式的单元格更新时,onEdit不触发吗? [英] onEdit is not firing when cell containing a formula is updated?
问题描述
我正在使用onEdit触发单元格值更改。但是,如果由于公式而更新了单元格值,则onEdit无法正常工作。任何解决方法?
I am using onEdit to trigger on a cell value change. But if the cell value is updated because of the formula then onEdit is not working. Any workaround for this ?
推荐答案
无直接解决方案。如下所述: GAS-triggers-forumla
No direct solution. as explained here: GAS-triggers-forumla
简单触发器仅在用户修改工作表时起作用。如果要检测由于公式导致的单元格更改,一种解决方法是使用基于时间的触发器,该触发器将使用旧值检查单元格的当前值,并将其存储为脚本/用户的属性。这样,它将知道在固定时间后是否有更改。
the simple triggers only work when a user modifies the sheet. If you want to detect changes in a cell due to a formula, a workaround would be to have a time-based trigger which checks the current value of the cell with the old value, stored as a 'property' of the script/user. In this way it'll know if there'a a change after a fixed amount of time.
这篇关于包含公式的单元格更新时,onEdit不触发吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!