如何使用应用程序脚本在Google Spreadsheeet中移动工作表 [英] How to move sheet within Google Spreadsheeet using apps script
本文介绍了如何使用应用程序脚本在Google Spreadsheeet中移动工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用应用程序脚本在电子表格中移动工作表. 怎么做?
I want to move a sheet within the spreadsheeet using apps script. How to do it?
最佳直播!
推荐答案
您是否看过它也显示了一个示例:
// 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());
这篇关于如何使用应用程序脚本在Google Spreadsheeet中移动工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文