Created
August 26, 2016 05:37
-
-
Save rheajt/786fcd615c3d7e5acdb42165cf7af151 to your computer and use it in GitHub Desktop.
duplicate a template sheet in google sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function duplicate() { | |
//number of duplicates to make | |
var numOfDupes = 40; | |
//create the spreadsheet object | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
//we are going to loop the number of duplicates we want | |
for(var i = 1; i <= numOfDupes; i++) { | |
//this line of code duplicates the active sheet in the spreadsheet | |
//be careful that you have the correct sheet activated, or be sure to explicitly activate in the code | |
ss.duplicateActiveSheet().setName('Week ' + i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment