📜  谷歌应用程序脚本将电子表格范围转换为变量 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:29.028000             🧑  作者: Mango

代码示例1
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
var range = sheet.getRange('A1:D10');
//range.activate();
var values = range.getValues();
//Logger.log(values[0][0]);
var selection = sheet.getSelection();
// Current cell: A1
var currentCell = selection.getCurrentCell();
// Active Range: A1:D10
var activeRange = selection.getActiveRange();