fires before a sheet is renamed

boolean BeforeSheetRename(object sheet,string newVal){ ... };


sheetobjectthe object of a sheet
newValstringthe new name of the sheet


booleantrue to rename a sheet, false to prevent a sheet from being renamed

Example"beforeSheetRename", function(sheet, newVal) {
    console.log("The ",, "sheet will be renamed to ", newVal);
    return true;


The sheet object contains the following parameters:

  • name - (string) the old name of the sheet
  • id - (string) the id of the sheet

The event is blockable, returning false will prevent the sheet from being renamed.

Change log

added in v4.1

Back to top