jakub
jakub

Reputation: 5104

How can I rename sheet in a different spreadsheet?

I have copied multiple sheets from one spreadsheet to another using the copyTo(spreadsheet) method. As the documentation suggests,

The copied sheet will be named "Copy of [original name]".

How can I rename that sheet, which is now effectively located in a different spreadsheet than the one hosting my script?

Upvotes: 1

Views: 596

Answers (1)

miketreacy
miketreacy

Reputation: 1120

I know this can be done with a Spreadsheet when making the copy but I don't believe this is possible with just a copy of a sheet (with a single call).

I think you'll need to get it by the 'Copy of' name and use setName.

Upvotes: 1

Related Questions