In this Excel tutorial, you will learn how to
– Delete a sheet in Excel
– Delete multiple sheets
– Use VBA to delete sheets
We have used Microsoft 365 to prepare this article. You can use these methods in Excel 2021, 2019, 2016, and 2013.
Sometimes it is necessary to delete an irrelevant sheet in the workbook. Unnecessary worksheets decrease the readability of a workbook. While using Excel, it is a very basic skill to know how to delete a sheet or multiple sheets of the workbook.
Download Practice Workbook
How to Delete a Sheet in Excel?
I showed 5 easy ways of deleting a sheet in Excel. These are using Home tab, context menu, navigation pane, keyboard shortcuts, and context menu with keyboard.
1. Use Home Tab
- First, click on the sheet you want to delete. Keep it as the active sheet.
- Afterward, click on the Home tab and then click the Delete option under it.
- From the Delete option, select Delete Sheet.
- Thus, a prompt will appear.
- Lastly, select the Delete option.
- Eventually, the Use_Home_Tab worksheet has been deleted.
2. Apply Context Menu from Sheet Tab
- To begin, right-click on the sheet.
- Then select the Delete option.
- Click on the Delete option from the prompt.
- Consequently, the Apply_Context_Menu sheet has been deleted from the worksheet.
3. Use Navigation Pane from View Tab
- Initially, click on the View tab.
- Then select Navigation.
- Therefore, the Navigation pane will appear.
- Now, select Use Navigation Pane.
- Lastly, click on the Delete option.
- A Microsoft Excel prompt will be shown.
- Click on the Delete option.
- Hence, the worksheet is deleted from the workbook.
4. Use Keyboard Shortcuts to Delete Sheet in Excel
4.1 Apply Keyboard Shortcut
- Firstly, select the sheet.
- Then press Alt key and hold.
- Now press H + D + S one by one on the keyboard.
- Delete or Cancel prompt will appear on the screen.
- Select the Delete option if you really want to delete that sheet.
- Therefore, the selected worksheet has been deleted.
4.2 Apply Legacy Keyboard Shortcut
- Firstly, select the sheet.
- Then press and hold the Alt key.
- Now, press E and L on the keyboard.
- From the Microsoft Excel prompt, click on the Delete button.
- As a result, the worksheet has been deleted.
5. Use Right-Click and Keyboard Together
- Right-click on the sheet that you want to delete.
- And then press D on the keyboard.
- A prompt with the Delete option will appear.
- Select Delete and the worksheet will be deleted successfully.
- Finally, you have deleted the sheet.
Read More: Shortcut to Delete Sheet in Excel
How to Delete Multiple Sheets in Excel?
You need to know how to select multiple sheets first. Then you can delete those selected sheets. I will show how to delete multiple adjacent or non-adjacent sheets here.
1. Use Home Tab
- First, press and hold the shift key from the keyboard.
- Then select the sheets one by one that you want to delete.
- Afterward, click on the Home tab >> select the Delete option.
- Now, click on Delete Sheet and the selected sheets has been deleted.
2. Use Mouse and Keyboard
2.1 Use Shift Key and Right-click on Mouse for Adjacent Sheets
- Press and hold the shift key and select the sheets you want to delete.
- Then, right-click on the mouse.
- Now, select the Delete option or press D on the keyboard.
- Thus, all the selected sheets will be deleted.
2.2 Use Alt Key and Right-click on Mouse for Non-Adjacent Sheets
- Press the Alt key and holding this key you can select nonadjacent sheets.
- So, select the sheets you want to delete from the workbook and right-click on the mouse.
- Then, select the Delete option or type D on the keyboard.
- Therefore, the selected non-adjacent sheets will be deleted.
Read More: How to Delete Multiple Sheets in Excel
Can I Use VBA to Delete Sheets in Excel?
To write any VBA code, you must launch the VBA Editor first.
- To do that, click on the Developer tab from Excel Ribbon. If you don’t have the Developer tab in Excel Ribbon, you have to enable it from Excel Options.
- Afterward, select the Visual Basic option.
- After clicking on Visual Basic, Excel will lead you to the VBA Editor In this window, you can write your VBA code.
- Now, select Insert and add a new Module.
1. Delete the Active Sheet
Here, Sample_Dataset is the active worksheet.
- Now, write this code in your VBA editor window.
Sub Delete_active_sheet()
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
End Sub
- Run the code by pressing F5 on the keyboard, and the active sheet is deleted from the workbook.
2. Delete a Sheet by Name
- In this workbook, Sales_Data sheet is the active sheet.
- Now, copy this code and paste it to your VBA code editor.
Sub delete_sheet_by_name()
Application.DisplayAlerts = False
Sheets("Sales_Data").Delete
Application.DisplayAlerts = True
End Sub
- Lastly, Run the code, and the Sales_Data named sheet is deleted from the workbook.
3. Delete Sheets with a Specific Text in Sheet Name
Here, in this workbook I have 4 Sheets which contain sales and product details of 2020 and 2021. I want to delete all the sheets which contain the text “2020”. I use VBA code to do this.
- Copy this VBA code in your VBA code editor.
Sub DeleteSheetsWithSpecificText()
Dim ws As Worksheet
Dim searchText As String
Dim wsToDelete As Worksheet
' Define the text you want to search for in sheet names
searchText = "2020"
' Loop through all worksheets in the workbook
For Each ws In ThisWorkbook.Worksheets
' Check if the sheet name contains the specified text
If InStr(1, ws.Name, searchText, vbTextCompare) > 0 Then
' Set the sheet to delete
Set wsToDelete = ws
' Delete the sheet without confirmation
Application.DisplayAlerts = False
wsToDelete.Delete
Application.DisplayAlerts = True
End If
Next ws
End Sub
- Press the F5 key to run the code.
- Therefore, the two sheets which contained the text “2020” have been deleted.
4. Delete All Sheets Except Active Sheet
- Write this code in your VBA editor.
Sub Delete_sheets_except_active_sheet()
Application.DisplayAlerts = False
For Each ws In Worksheets
If ws.Name <> ActiveSheet.Name Then
ws.Delete
End If
Next ws
Application.DisplayAlerts = True
End Sub
- Now, Run this code, and all the sheets will be deleted except the active sheet.
Which Things You Have to Keep in Mind?
- Check if any other sheets or formulas in your workbook depend on the sheet you want to delete.
- If any sheet is protected with a password, you have to unprotect it before deleting.
- When you delete a sheet, it is permanently removed from the workbook. So be sure about deleting any workbook.
Frequently Asked Questions
1. How do I Delete all data from a sheet?
Answer: Firstly, select all the cells in the sheet. Click on the upper-left corner of the sheet (where the row numbers and column letters intersect). Then, right-click on the selected cells and choose the “Delete” option from the context menu.
2. How to insert a sheet in Excel?
Answer: Click on the “+” sign beside the existing sheets of the workbook. By clicking the + sign you have inserted a new sheet.
3. Why can’t I delete sheet in Excel?
Answer: Following are the reasons behind why you can’t delete sheet in Excel:
- The sheet you are trying to delete might be protected. You need to unprotect the sheet before you can delete it. To unprotect a sheet, go to the “Review” tab >> click “Unprotect Sheet,” >> enter the password if required.
- If the sheet you want to delete is hidden, you need to unhide it first. Right-click on any sheet tab at the bottom of the Excel window, select “Unhide,” >> choose the sheet you want to delete.
- If there is a macro in your workbook that prevents sheet deletion, you need to modify the code. Ensure there are no macros that are trying to protect the sheet.
- If the workbook is shared, it might restrict deleting sheets.
Conclusion
I hope this article has helped you to learn the ways of deleting a sheet or multiple sheets in Excel. I have described multiple methods of doing this. These are using Home tab, context menu, navigation pane, keyboard shortcuts, mouse and keyboard together, VBA etc. You have to apply the method which is easy and relevant for you. If you have any question regarding this, please leave a comment.
Delete Sheet in Excel: Knowledge Hub
- How to Delete All Sheets in Excel Except One
- How to Delete Hidden Sheets in Excel
- How to Undo Delete Sheet in Excel
- [Fixed!] Delete Sheet in Excel Not Working
<< Go Back to Worksheets | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!