我正在尝试从一张纸上复制值: https://docs.google.com/spreadsheets/d/1UDWk1xGnnL6qH_l5vo2MMwGH8wyXu0D9DCQMmZEKUJ0/edit#gid=0
我在那里尝试了代码,但是当我运行它时,什么也没有发生。我是编程的新手,所以也许这是一些基本的东西。
function myFunction() {
function transferList() {
var sourceSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("OVERVIEW");
var sourceData = sourceSheet.getDataRange().getValues();
var targetSS = SpreadsheetApp.openById("1dWYj2W3gTDnNuqgX9O9RS0WWL02aDUQAVl1HJ5jTtvE").getSheetByName("RAWDATA");
var targetRangeTop = targetSS.getLastRow();
targetSS.getRange(targetRangeTop+1,1,sourceData.length,sourceData[0].length).setValues(sourceData);
}
}
我希望将值复制到最后一个可用行...
答案 0 :(得分:0)
function transferList() {
var sourceSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("OVERVIEW");
var sourceData = sourceSheet.getDataRange().getValues();
var targetSS = SpreadsheetApp.openById("1dWYj2W3gTDnNuqgX9O9RS0WWL02aDUQAVl1HJ5jTtvE").getSheetByName("RAWDATA");
var targetRangeTop = targetSS.getLastRow();
targetSS.getRange(targetRangeTop+1,1,sourceData.length,sourceData[0].length).setValues(sourceData);
}