Duplicate a Google Sheets Tab Every Week Automatically

Learn how to automatically duplicate a Google Sheets template every week using Apps Script. This tutorial covers setting up a trigger to create a new sheet with the current date as its name.

so you want to duplicate a sheet a template every single week on a particular day let's do this we have a template it's just sales for the week we're going to create an appscript if you don't know where that is go to extensions appscript and it will bring up this appscript editor we'll create a function called create new template we can name this anything we want here we'll create a variable called sheet name we need to name the sheet something we're probably going to want to call it something like the date do utilities. format at date we'll format the date as this today we need another variable up here called variable today equals new date then we're going to add a time zone I'm just going to do GMT plus 6 you can put any time zone you're in there and Richard Asks: Copy Template Tab and Rename to Date Every Week Automatic Weekly Backup of Google Sheets Richard Asks: Copy Template Tab and Rename to Date Every Week Happy Sheet

we're going to name this mmm D this is just the three first letters of the month and the day that's whatever the day is that it's going to be created now we need to create another variable SS equals just the spreadsheet that we're on spreadsheet . get active spreadsheet now we want to take the sheet that we're on get sheet by name in this case it's going to be called template we're going to copy to the same spreadsheet once we copy it we're going to set name we're going to set the name to the sheet name variable that we did up here so whatever this formatted dated it's going to be five characters the first three letters of the month and the date five or six characters we're going to save this and in order to do this every single week we're going to need to create a trigger but Let's test it first we're going to Different Kinds of Automation Getting Started Coding in Apps Script Richard Asks: Copy Template Tab and Rename to Date Every Week How To Duplicate a Template For Every Day of the Year

hit run it's going to ask us to authorize once we authorize it'll work we can go check our template and there it is our template exists still and now we have November 12th today is the 12th of November now we're going to go over to the left click triggers and we're going to click add trigger it's on the bottom right here we'll choose the function to run create new template for now it's the only function in our spreadsheet select Event Source we're going to change this to time driven and instead of our timer we're going to do week timer we're going to select whatever day of the week we want it to be created sometimes we'll want it created at the beginning of the week so Monday before everyone comes in sometimes we'll want to create it on a Tuesday or Wednesday depending on maybe we have a meeting that this needs to be created by or end of day Friday or even over the weekend sometimes some people Richard Asks: Copy Template Tab and Rename to Date Every Week Automatic Weekly Backup of Google Sheets Duplicate Template Insert Row Daily Automatically

work late on Fridays whenever you need to create this remember the name will be the day so let's create it every Monday and let's create it 4: to 5 a.m. so before anyone comes in and if if there's any errors here it'll send me an email or I'll be able to see the error and I'll be able to fix it in the morning on Monday if this trigger doesn't happen we'll hit save if you didn't authorize before It'll ask you to authorize once you save it and here you'll be able to see the error rate and click the three dots on the right side and here you can delete the trigger click the pencil icon and edit it in any way you want to maybe you want to change the day or the time that this is being created yeah it'll be created now every week on a Monday if you're looking to get more out of your Google Sheets than you ever have before consider subscribing here on YouTube on Automatic Weekly Backup of Google Sheets Email Yourself a Cell from a Google Sheet, Every Day How to Trigger Macros Daily Happy Sheet

better sheets Secure Your Sheets by BetterSheets.co

Big Year 2027 calendar: the whole year on one Google Sheet

Free 2027 calendar.

Copy it to your Google Drive.

Free. No password, no card. The sheet link shows up right here.