【发布时间】:2018-02-01 00:08:32
【问题描述】:
我想从一个单元格设置注释——注释应该设置到同一个单元格。
我试过这个功能
function setNote(note){
var note = note;
var cell = SpreadsheetApp.getActiveSheet().getActiveCell();
if(note == ""){
cell.clearNote();
}else{
cell.setNote(note);
}
}
但出现错误You do not have permission to call setNote (line 8),这很明显,因为我无法使用“单元格函数”(在单元格中输入/键入的函数而不是 GAS/JavaScript 函数本身)编辑任何单元格。
有没有办法从单元格本身设置音符(使用“单元格函数”)?
我希望能够在单元格内设置单元格值(我已经可以)和注释(我还不能),例如 '=if(d4=4 , e4, "") & setNote(b4)` ... 或类似的东西。
【问题讨论】:
标签: google-apps-script google-sheets custom-function