How to Delete Multiple Sheets in Excel (3 Ways)

In this tutorial, we will explore 3 ways to delete multiple sheets in Excel, and how to do so based on different criteria.

To illustrate, we have an Excel file with some sales and profit sheets, and we’ll delete multiple sales sheets as shown in the following image.

delete multiple sheets in excel


 

Method 1 – Using Delete Sheet Command From the Ribbon

This method is suitable for users who prefer the Ribbon interface over right-clicking on sheet tabs.

STEPS:

  1. Select the sheets to delete.
    • For adjacent sheets, hold Shift > first sheet > last sheet.
    • For non-adjacent sheets, hold Ctrl and select the sheets one by one.

    Use Ribbon Option to Delete Multiple Sheets in Excel

  2. Go to the Home tab > Cells group > Delete drop-down > Delete Sheet.
    Use Ribbon Option to Delete Multiple Sheets in ExcelA confirmation dialogue box will appear.
  3. Click on Delete.
    Use Ribbon Option to Delete Multiple Sheets in Excel

This will delete the selected sheets.

multiple sheets deleted from the workbook using ribbon command

Shortcut: Press Alt+H > D > S on the keyboard to directly delete the selected sheets.

Method 2 – Using Context Menu

Use this method if you have a small number of sheets to delete, or when the sheets to be deleted are easily identifiable by their names or positions,

STEPS:

  1. Select the sheets to delete.
    • For adjacent sheets, hold Shift > first sheet > last sheet.
    • For non-adjacent sheets, hold Ctrl and select the sheets one by one.

    Use Sheet Option to Delete Multiple Sheets in Excel

  2. Right-click on any of the selected sheets.
    The sheet context menu will appear.
  3. Click on Delete or press D on the keyboard.

This will delete the selected sheets without a warning or confirmation box.

multiple sheets deleted using context menu


Method 3 – Using VBA Code

VBA code comes in handy when you need to delete a large number of sheets, especially if they follow a specific pattern. It’s also useful for repeated tasks in the same or across multiple workbooks.

STEPS:

  1. Press Alt+F11 to open the Microsoft Visual Basic for Applications window.
    Or, go to the Developer tab > Code group > Visual Basic.
    opening the VBA editor window
  2. Select Insert > Module.
    inserting a moduleThe Module window will appear.
  3. Insert the following code in the Module window:
    Sub Delete_Multiple_Worksheets()
    'Turn off the display alerts
    Application.DisplayAlerts = False
    'Deleting multiple worksheets
    Worksheets("Sales1").Delete
    Worksheets("Profit1").Delete
    'Turn on the display alerts back
    Application.DisplayAlerts = True
    End Sub
  4. Click on the Run icon or press F5.
    vba code to delete multiple sheets in Excel

This will delete all the sheets mentioned in the VBA code.

multiple sheets deleted using VBA code

Note: To get the confirmation dialog boxes, exclude the following lines from the code:

Application.DisplayAlerts = False
Application.DisplayAlerts = True

How to Delete Multiple Sheets Based on Conditions in Excel?

You may need to delete multiple sheets based on certain conditions such as deleting all sheets except the active one or deleting a group of sheets with specific names or strings. Using the VBA code is most effective in such scenarios since using the Excel features is a lengthy process for a large number of sheets.

Here are two cases of deleting multiple sheets based on conditions in Excel:


Case 1 – Delete All Sheets Except the Active Sheet

In this example, the current sheet is “Profit1“. We will delete all the sheets except this one.

STEPS:

  1. Press Alt+F11 to open the Microsoft Visual Basic for Applications window.
    Or, go to the Developer tab > Code group > Visual Basic.
    opening the VBA editor window
  2. Select Insert > Module.
    inserting a moduleThe Module window will appear.
  3. Insert the following code in the Module window:
    Option Explicit
    Sub deletemultiplesheets()
    Dim spreadsheet As Worksheet
    Application.DisplayAlerts = False
    For Each spreadsheet In Sheets
    If spreadsheet.Name <> ActiveSheet.Name Then
    spreadsheet.Delete
    End If
    Next spreadsheet
    Application.DisplayAlerts = True
    End Sub
  4. Click on the Run icon or press F5.
    vba code for deleting all sheets except the active sheet

This will delete all the sheets except the active sheet.
all sheets except active sheet is deleted


Case 2 – Delete Sheets With a Specific Text String

In this example, we will remove every worksheet containing the string “Sales“. You can use any string instead of “Sales” in the code.

STEPS:

  1. Press Alt+F11 to open the Microsoft Visual Basic for Applications window.
    Or, go to the Developer tab > Code group > Visual Basic.
  2. Select Insert > Module.
    The Module window will appear.
  3. Insert the following code in the Module window:
    Option Explicit
    Sub DeleteSheetWithSameName()
    Dim spreadsheet As Worksheet
    Application.DisplayAlerts = False
    For Each spreadsheet In sheets
    ‘Replace Sales1 with the desired string
    If spreadsheet.Name Like "*" & "Sales" & "*" Then
    spreadsheet.Delete
    End If
    Next spreadsheet
    Application.DisplayAlerts = True
    End Sub
  4. Click on the Run icon or press F5.
    vab code to delete sheets with specific string

This will delete all the sheets with a specific text string.
multiple sheets with a single string in the name deleted


Practice Workbook


Frequently Asked Questions

Can I recover deleted sheets in Excel?

No, you can not recover deleted sheets in Excel. Deleting sheets is an irreversible process.

Are there any alternatives to deleting sheets in Excel?

Instead of deleting sheets, you can hide them if you want to temporarily remove them from view. Right-click on the sheet tab and choose “Hide“. Hidden sheets can be unhidden by right-clicking on any sheet name > Unhide > OK.

Can I delete sheets from a protected workbook or worksheet?

Only if you unprotect the sheet first. Right-click on the sheet tab, choose “Unprotect Sheet” (if applicable), and then proceed with deletion.


Related Articles


<< Go Back to Delete Sheet | Worksheets | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nuraida Kashmin
Nuraida Kashmin

Nuraida Kashmin, Bachelor's degree in Mechanical Engineering from Rajshahi University of Engineering & Technology. Since 2021, she wrote 45+ articles on Excel problems and reviewed over 1000 articles. Currently working as a Project Manager, she is responsible for developing and implementing content strategies, managing writers and editors, staying updated on new technology, analyzing data, and tracking content performance indicators. Her interests include Project Management, Creative Writing, Digital Marketing, Reporting, Monitoring & Documentation, and Online Advocacy for SAP &... Read Full Bio

2 Comments
  1. Hi, I have multiple excel files with few sheets in each file. I want to delete one particular sheet having same name in all files. is there any short cut please.

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo