2

如何在电子表格末尾移动复制的工作表(列表)?

 function makecopy() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sourceSheet = ss.getSheetByName('List');
  var values = sourceSheet.copyTo(ss);
  }
4

1 回答 1

6

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
  }
于 2013-09-22T17:42:44.667 回答