【问题标题】:Going to sheet based on date根据日期前往工作表
【发布时间】:2021-12-09 17:24:16
【问题描述】:

我每天都有一张纸。示例:2022 年 1 月 3 日 > 工作表名称为 3/01/2022

当我打开谷歌电子表格文件时,我希望活动工作表是实际日期的工作表。因此,在 2022 年 1 月 5 日打开电子表格时,活动工作表 5/1/2022 应该在我面前。

我该怎么做?

感谢您的帮助

【问题讨论】:

标签: google-apps-script google-sheets


【解决方案1】:

按日期获取工作表

function onOpen() {
  gotoPage();
}

function gotoPage() {
  const ss = SpreadsheetApp.getActive();
  const name = Utilities.formatDate(new Date(),ss.getSpreadsheetTimeZone(),"MM/dd/yyyy");
  const sh = ss.getSheetByName(name);
  sh.activate();
}

到那里有点慢,但对我有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-22
    • 1970-01-01
    • 2013-04-19
    • 1970-01-01
    • 2020-12-09
    • 1970-01-01
    相关资源
    最近更新 更多