调用函数(makeActive)时,我需要Google工作表来选择特定的单元格(B3)。应该选择该单元格,就像用户自己单击该单元格一样。
答案 0 :(得分:1)
就像[meta.unary.prop] table 47一样简单:
// The code below sets the cell B5 in the first sheet as the current cell.
var cell = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0].getRange('B5');
SpreadsheetApp.setCurrentCell(cell);
var selection = SpreadsheetApp.getSelection();
// Current cell: B5
var currentCell = selection.getCurrentCell();