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
Post a Comment