【发布时间】:2022-10-17 06:40:17
【问题描述】:
所以我有一个谷歌表格脚本,可以编辑第 1 列以“打印”第 14 列中的某些内容,这很有效。但我希望打印更具动态性,并打印在 OnEdit 执行 (=C1+1) 时该公式的值,因为单元格 C1 每周更改。那么我如何让这个脚本“打印”那个公式的结果呢?
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Current Loads 2020" ) { //checks that we're on Sheet1 or not
var r = s.getActiveCell();
if( r.getColumn() == 1 ) { //checks that the cell being edited is in column A
var nextCell = r.offset(0, 14);
if( nextCell.getValue() === '' ) //checks if the adjacent cell is empty or not?
nextCell.setValue("Pinted Value");
}
}
}
【问题讨论】:
标签: google-apps-script google-sheets triggers