How to Automatically Copy Tab Every Week
Learn how to automate the process of copying a checklist tab in Google Sheets every week using Apps Script and triggers, ensuring you start each week with a fresh template ready for use.
We want to automatically copy this tab, this checklist , every single week. We have a checklist of items that we want to check off during the week, but on Monday we want a fresh new one created for that week. We have this template called Checklist , and we're going to copy it. We could absolutely click here, Copy to Existing Spreadsheet . We could absolutely click here, Copy Duplicate and rename this to whatever February 24th, whatever date it is right now. But we want to automate it. We want this ready for us to start work right away on Monday automatically without us having to do this tedious work. So I'm going to show you how to do this. We need three things. One, we need a template , this checklist. Two, we need an Apps Script, which we're going to create here.
And third, we're going to need a trigger . We're going to create a function new checklist . This function will do one thing, which will go to this checklist and copy it. We need variable checklist equals spreadsheet app dot get active spreadsheet dot get sheet by name and here in quotes checklist. And now we're going to do checklist dot copy to. Where are we going to copy it? To this exact spreadsheet. Just the spreadsheet that we're in. And now we can set the name to whatever we want. Maybe we want to set the name to a date. So we do variable date equals utilities dot format date. And we need new date. This exact syntax, new then capital D date with parentheses. And we can add a time zone here.
I'm going to just write time zone plus date. GMT plus zero, and we need a format . Format could be something like MMM, three M's, a day, and the year, perhaps. And so we're going to say the name is this date. So we click run if we want to run it right now. We have to review our permissions and set authorization . If we go back to our sheet, we have a new tab. It's called February 24th, and it's all here. It copied it right here. Absolutely perfectly. If you have any failure or any issues with this, check that this function is as I wrote it here. But let's automate it. We don't want to have to come in here and click run. That's the same as just duplicating it ourself. Go over to triggers on the left side. And on the bottom right, click add trigger . We're going to choose which function to run, new checklist . Scroll down to the bottom, we're going to go event source, time driven.
And here we will do a week timer. Every Monday and let's do just before we come into work 5 to 6 a. m. Click Save. If you haven't yet, it'll ask you to authorize now. Just go ahead and authorize it. It's going to be running as you. And now every Monday we will have a new checklist in our sheet ready for us to start the work week. Thanks for watching. Make sure you subscribe right now to automate your sheets. Make your spreadsheets work while you sleep.