Skip to content

Instantly share code, notes, and snippets.

@mgalgs
Created August 26, 2016 15:25
Show Gist options
  • Save mgalgs/733f0f83c74539a3096adfe82e3b1b9d to your computer and use it in GitHub Desktop.
Save mgalgs/733f0f83c74539a3096adfe82e3b1b9d to your computer and use it in GitHub Desktop.
Tools -> Script Editor, and paste in the following code
var dayNumToName = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
];
function selectTabBasedOnDay() {
var dow = (new Date()).getDay();
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(dayNumToName[dow]);
if (sheet !== null)
sheet.activate();
}
function onOpen() {
selectTabBasedOnDay();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment