sno*_*p31 2 google-apps-script
如何在电子表格的末尾移动复制的工作表(列表)?
function makecopy() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sourceSheet = ss.getSheetByName('List');
var values = sourceSheet.copyTo(ss);
}
Run Code Online (Sandbox Code Playgroud)
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
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1958 次 |
| 最近记录: |