将工作表选项卡移动到最左侧使用脚本 [英] Move Sheet Tab to the Far Left Using Script

查看:102
本文介绍了将工作表选项卡移动到最左侧使用脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以有一个小脚本来重新排列工作表标签的顺序,将当前选定的工作表标签移动到Google Spreadsheet中所有标签的最左侧(开头)?

Is it possible to have a small script that will re-arrange the order of the sheet tabs moving the currently selected sheet tab to the far left (the beginning) of all the tabs in a Google Spreadsheet?

推荐答案

是和否。可以通过甜名称完成,但不能通过您正在查看的当前工作表完成。下面是我写的一些代码,每天都会让甜心移动到第一位。

Yes and No. It can be done by sweet name, but not by the current sheet you are looking at. Below is some code I wrote that moves a sweet to the first position every day.

function tab() { 

  var reportDate = new Date();
  var tabName = Utilities.formatDate(reportDate, 'MST', 'yyyy-MM-dd').toString(); 
  var tab = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(tabName);
  SpreadsheetApp.setActiveSheet(tab);
  SpreadsheetApp.getActiveSpreadsheet().moveActiveSheet(1);

} 

这篇关于将工作表选项卡移动到最左侧使用脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆