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.
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:
- 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.
- Go to the Home tab > Cells group > Delete drop-down > Delete Sheet.
A confirmation dialogue box will appear. - Click on Delete.
This will 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:
- 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.
- Right-click on any of the selected sheets.
The sheet context menu will appear. - Click on Delete or press D on the keyboard.
This will delete the selected sheets without a warning or confirmation box.
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:
- Press Alt+F11 to open the Microsoft Visual Basic for Applications window.
Or, go to the Developer tab > Code group > Visual Basic.
- Select Insert > Module.
The Module window will appear. - 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
- Click on the Run icon or press F5.
This will delete all the sheets mentioned in the 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:
- Press Alt+F11 to open the Microsoft Visual Basic for Applications window.
Or, go to the Developer tab > Code group > Visual Basic.
- Select Insert > Module.
The Module window will appear. - 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
- Click on the Run icon or press F5.
This will delete all the sheets except the active sheet.
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:
- Press Alt+F11 to open the Microsoft Visual Basic for Applications window.
Or, go to the Developer tab > Code group > Visual Basic. - Select Insert > Module.
The Module window will appear. - 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
- Click on the Run icon or press F5.
This will delete all the sheets with a specific text string.
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
- Shortcut to Delete Sheet in Excel
- How to Delete Hidden Sheets in Excel
- How to Delete All Sheets in Excel Except One
- How to Undo Delete Sheet in Excel
- [Fixed!] Delete Sheet Not Working in Excel
<< Go Back to Delete Sheet | Worksheets | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!
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.
Hi SIVA!
You can check this article – https://www.exceldemy.com/delete-same-sheet-from-multiple-workbooks-in-excel-vba/
I hope it’ll be helpful for you.