B
B
BeardMin2022-03-10 17:55:52
Google Apps Script
BeardMin, 2022-03-10 17:55:52

How to auto-open sheet by day in Google Sheets?

Can you please tell me how to make this wish come true?
There is a Google Spreadsheet with day and month, i.e. 10.03 in the title of the sheet, how to make it so that when you open the document, this day opens, and the sheet 11.03 the next day?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2022-03-10
@BeardMin

Example in Spreadsheet https://docs.google.com/spreadsheets/d/1afP_NGm4V7...
I would move the sheet to the beginning once a day on a trigger - it's much neater and doesn't flicker.

function triggerSction() {
  const book = SpreadsheetApp.getActiveSpreadsheet();
  const sheetName = 
    Utilities.formatDate(new Date(), book.getSpreadsheetTimeZone(), 'dd.MM');
  const sheet = book.getSheetByName(sheetName);
  if (sheet) {
    sheet.activate();
    book.moveActiveSheet(1);
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question