Rename sheet name

Here is how to rename or change sheet name.

Source code

function renameSheet(){
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // Get Active spreadsheet object
  var sh = spreadsheet.getActiveSheet(); // Get Active sheet's object
  sh.setName("Name changed!");
}

Format

SheetObject.setName(string)

Parameters

string … New sheet name you like

Note

Sheet ID is an unique key provided automatically thus you cannot edit it.

How to get sheet name or sheet id?

Please refer the following post;

Get sheet name and sheet id

Leave a Comment