我有以下代码从活动行中获取所需的所有信息,并将它们放入变量数组中。但是,我似乎无法找到关于如何将变量附加到同一文档中的另一个工作表的良好文档:
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
var spreadsheetTimeZone = SpreadsheetApp.getActive().getSpreadsheetTimeZone();
var lastUpdatedString = Utilities.formatDate(new Date(), spreadsheetTimeZone, "MM/dd/yyyy' 'HH:mm:ss");
var sessionEmail = Session.getActiveUser().getEmail();
if (s.getName() == "Workload") { //checks that we're on the correct sheet
var r = s.getActiveCell();
if (r.getColumn() == 14) { //checks the column
var status = r.getValue();
var note = r.offset(0, -1);
var noteValue = note.getValue()
var delivery = r.offset(0, -5);
var deliveryValue = delivery.getValue()
}
var array = [lastUpdatedString, sessionEmail, deliveryValue, noteValue]
// get destination range
var ss = SpreadsheetApp.getActiveSpreadsheet();
var pasteSheet = ss.getSheetByName("Historical Notes Sheet");
var destination = pasteSheet.getRange(pasteSheet.getLastRow() + 1, 1, 1, 1);
}
}
我想将var array
中的值附加到“历史记录表”中,其顺序与数组中的值相同。
非常感谢您提供的所有帮助/建议。
谢谢!