如何在电子表格末尾移动复制的工作表(列表)?
function makecopy() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sourceSheet = ss.getSheetByName('List');
var values = sourceSheet.copyTo(ss);
}
如何在电子表格末尾移动复制的工作表(列表)?
function makecopy() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sourceSheet = ss.getSheetByName('List');
var values = sourceSheet.copyTo(ss);
}
moveActiveSheet是电子表格对象的一个方法
这是一个例子:
function makecopy() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sourceSheet = ss.getSheetByName('List');// you can get the sheet by its name or by its index
var copy = sourceSheet.copyTo(ss);
Logger.log(copy.getName());// optional, just to check the copy's name
ss.setActiveSheet(copy);// set it active
ss.moveActiveSheet(ss.getNumSheets());// move it to the last position
}