How to Hide a Sheet Tab Automatically

Learn how to automatically hide and unhide sheet tabs in Google Sheets using Google Apps Script. This tutorial covers creating triggers to manage visibility based on time.

In a previous video, I showed you how to hide a sheet. We just go to next to the name of the tab and we hide a sheet, but I've also showed you how to hide it automatically. We'll go to app script and we have two functions here. One that hides a sheet. And we also have one that says unhide sheet . This is very interesting because we use a, name. Let's create a function , hide sales sheet, and we'll use the exact same function here, but we'll hide it, dot hide sheet. And now what we have is we have two functions, one that hides the sheet and one that unhides the sheet. Very specific sheet, we use get sheet by name. How do we set this to be automatic? Let's say we have an example where we have a summary or some kind of sales document that we want to see at the end of the day but we don't want to see most of the day. We want to unhide it around noon but we want to hide it at the end of the day Show Sheet Tabs Based on Edit Getting Started Coding in Apps Script Make a Tour of Your Sheet How to Hide Many Tabs Automatically

so that in the morning we don't see it. What we're going to do is we're going to create two triggers. So go over here to triggers on the left side, and on the bottom right we'll add a trigger . We'll choose which function to run. We'll hide the sheet. We'll select event source time driven. We'll choose day timer, that's every single day. We will hide it. From 6pm to 7pm at the end of the day, after the day is over. We'll click save. We have one trigger now that will hide the sales sheet. But now we want to create the trigger to unhide the sales sheet around lunchtime. So we unhide. We choose time driven. We'll select day timer as well. And we'll select 12 to 1. Save. Now we have two triggers. One that is unhiding around lunchtime. Noon and hiding it after the day is done at 6 p. m. So that we only see that tab during the afternoon. Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5 Learn to Code in Google Sheets, For Programmers | For Advanced Google Sheet Users Introducing SheetFools Automate Two Sheets

Very interesting.