How to move sheet within Google Spreadsheeet using apps script [duplicate]

隐身守侯 提交于 2020-02-28 00:56:19

问题


I want to move a sheet within the spreadsheeet using apps script. How to do it?

Best live!


回答1:


Have you looked at the documentation ?

It does show an example as well :

 // This example assumes there are two sheets in the current
 // active spreadsheet: one named "first", and another named "second",
 // and that the current active sheet (first) is in position 1
 var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
 var sheet = spreadsheet.getSheetByName("first");

 // This should output 'Current index of sheet: 1'
 Logger.log("Current index of sheet: %s", sheet.getIndex());

 spreadsheet.moveActiveSheet(2);

 // This should output 'New index of sheet: 2'
 Logger.log("New index of sheet: %s", sheet.getIndex());


来源:https://stackoverflow.com/questions/16401749/how-to-move-sheet-within-google-spreadsheeet-using-apps-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!