javascript - Create a new sheet in a Google Spreadsheet with Google Apps Script -


how create new sheet in google spreadsheet google apps script?

i know seems obvious want create new sheet specific name.

surprisingly didn't find clear , quick answer.

so here code:

function onopen() {     var activespreadsheet = spreadsheetapp.getactivespreadsheet();     var yournewsheet = activespreadsheet.getsheetbyname("name of new sheet");      if (yournewsheet != null) {         activespreadsheet.deletesheet(yournewsheet);     }      yournewsheet = activespreadsheet.insertsheet();     yournewsheet.setname("name of new sheet"); } 

finally, note new sheet automatically active one.


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -