【发布时间】:2016-09-02 01:55:14
【问题描述】:
我对 Google 脚本编写完全陌生,但我在这里使用了各种帖子来拼凑我需要的东西:当某一列发生变化时,它会为一行添加时间戳。这是我目前使用的:
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "test" ) { //checks that we're on the correct sheet
var r = s.getActiveCell();
if( r.getColumn() == 16 ) { //checks the column
var nextCell = r.offset(0, 1);
if( nextCell.getValue() === '' ) //is empty?
nextCell.setValue(new Date());
}
}
}
当我手动更改数据时,这非常有效;但是,脚本正在监视的列从另一个工作表中提取数据,这无法触发触发器/脚本。我怎样才能解决这个问题,以便带有公式(引用其他工作表)的单元格仍然会触发我的脚本?
非常感谢任何帮助。谢谢!
【问题讨论】:
标签: google-apps-script google-sheets