【发布时间】:2021-05-10 00:26:36
【问题描述】:
我将如何编写增加所选单元格的脚本。这是递增一个选定单元格的代码。单元格将始终包含自然数。
function increment() {
var currentCell = SpreadsheetApp.getCurrentCell();
var value = currentCell.getValue();
currentCell.setValue(value+1);
}
如果可能的话,我想要这样的东西
function increment(){
var selectedCells = SpreadsheetApp.getSelectedCells();
selectedCells.forEach( (e) => {
e.setValue(e.getValue() + 1 );
});
}
【问题讨论】:
标签: google-apps-script google-sheets