0
在谷歌表格中,我正在尋找在複製工作表中編輯特定單元格後,從一張表複製到另一表的數據。我有代碼,除了只被特定的單元格觸發以外,我還需要它。任何人都可以告訴我我錯過了什麼嗎?谷歌工作表onedit特定單元格
function OnEdit(e) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var destination = SpreadsheetApp.openById("1P6gj2UwfRmSMYZ4LBovvqbqy88aluOysPqWWhWbw_VE")
var source_sheet = ss.getSheetByName("Submit");
var destination_sheet = destination.getSheetByName("Point Tracker");
var source_range = source_sheet.getRange("A2:C2");
var editedcell = source_sheet.getRange("C2");
if(editedcell.getValue() !== 0){
var last_row = destination_sheet.getLastRow();
destination_sheet.insertRowAfter(last_row);
var destination_range = destination_sheet.getRange("A"+(last_row+1)+":C"+(last_row+1));
source_range.copyTo(destination_range,{contentsOnly:true});
source_sheet.getRange("C2").setValue("");
}
}
完美的作品。非常感謝你! – jc247
最受歡迎@ jc247。如果回答您的問題,請接受答案或註冊。 – JPV