0

I have a sheet for every day. Example: 3 january 2022 > sheet name is 3/01/2022

When I open the google spreadsheet file, I want the active sheet is the sheet of the actual date. So when opening the spreadsheet on 5 january 2022, the active sheet 5/1/2022 should be in front of me.

How do I do that?

Thanks for helping

player0
  • 124,011
  • 12
  • 67
  • 124
BRIVAN
  • 3
  • 2
  • https://webapps.stackexchange.com/questions/145827/how-to-open-a-specific-tab-based-on-todays-date-google-sheets – player0 Dec 09 '21 at 20:06
  • 1
    https://stackoverflow.com/questions/60496802/open-to-todays-date-within-multiple-tabs-in-a-sheet – player0 Dec 09 '21 at 20:06
  • 1
    https://stackoverflow.com/questions/16213555/google-apps-spreadsheet-open-specific-sheet-based-on-current-date-month – player0 Dec 09 '21 at 20:07

1 Answers1

0

Get Sheet by Date

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();
}

It's kind of slow getting there but it works for me.

Cooper
  • 59,616
  • 6
  • 23
  • 54