Delete sheet by name

Here is how to delete sheet by name.

Source code

function delSheetByName(){
  // Get Spreadsheet Object
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

  // Get target sheet object
  var sheet = spreadsheet.getSheetByName("Mini Dev Sheet");

  // Delete
  spreadsheet.deleteSheet(sheet);
}

 

Format

SpreadsheetObject.deleteSheet(sheet)

 

Parameters

sheet … Sheet object

 

How to get sheet object by name?

Please refer the following post;

Get a sheet object by name

Leave a Comment