I have a sheet names in column A of the active sheet.
I am trying to get each new tab to be a duplicate of my Template tab, but they are just blank.
Here is the code:
/** @OnlyCurrentDoc */
function makeTabs(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var last = sheet.getLastRow();
for(var i = 1; i < last ; i++){
var tabName = sheet.getRange(i+1,1).getValue();
var templateSheet = ss.getSheetByName("Template");
var create = ss.insertSheet(tabName,{template: templateSheet});
}
}
Can anyone tell why created sheets are not based on template?
