Delete an active sheet

Here is how to delete an active sheet.

 

Source code

function delActiveSheet(){
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  spreadsheet.deleteActiveSheet();
}

 

Format

SpreadsheetObject.deleteActiveSheet()

 

Note

If there is only 1 sheet, an error message will be shown when you run this script.

Leave a Comment