Skip to content
Julian Halliwell edited this page Sep 20, 2021 · 4 revisions

Changes the name of the sheet specified by number to the given name.

renameSheet( workbook, sheetName, sheetNumber )

Required arguments

  • workbook spreadsheet object
  • sheetName string: the new name to give the sheet. Must not be the name of an existing sheet.
  • sheetNumber numeric: the number of the sheet to rename

Chainable? Yes.

Note

Will throw an exception if you try to rename to an existing sheet name.

Example

spreadsheet = New spreadsheet();
workbook = spreadsheet.new(); // creates "sheet1" by default
spreadsheet.createSheet( workbook,"sheet2" );
spreadsheet.renameSheet( workbook,"sheetTwo",2 );
Clone this wiki locally