4

In a Google Sheets spreadsheet (Excel terminology = workbook) is it possible to delete multiple tabs (Excel terminology = worksheet) in one go without having to right click each one and delete it.

6
  • this deletes all sheets except Sheet1, Sheet2 and Sheet3

function DELETESHEETS() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheets = ss.getSheets();
  for (i = 0; i < sheets.length; i++) {
     switch(sheets[i].getSheetName()) {
     case "Sheet1":
     case "Sheet2":
     case "Sheet3":
     break;
     default:
     ss.deleteSheet(sheets[i]);}}}

| improve this answer | |
0

Use Bulk Sheet Manager. It also allows you to hide sheets, which may be useful if sheets have some dependency.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.