2
votes

I'm looking for a way to add a colour to a newly created sheet within a spreadsheet by a google-apps-script application.

In the documentation, I see that there is a options parameter provided in the insertSheet section. But I haven't found any documentation about it and there are no examples.

Where can I find a documentation to these options?

2

2 Answers

1
votes

I can't answer your question re. the documentation for the options but I would normally do this

function copySheet(){
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var templateSheet = ss.getSheetByName('Sheet1');
 ss.insertSheet('New Sheet',{template: templateSheet)}.setTabColor('RED');
}

to set the tab colour and rename the sheet.

1
votes

The documentation regarding the options parameter can be found just some few lines below in the same section you mentioned under "Advanced parameters".

It may seem confusing at first as the only possible parameter is "template".

insertSheet documentation