In Microsoft Excel, you might need to protect your file from deletion. After completing a file you may send it to viewers and you don’t want the viewers to make any unintentional changes to the file. Excel does have some built-in features to protect your excel sheet from deleting data or cells with formulas.
How to Protect Excel Sheet from Deleting: 3 Quick Methods
In this article, I will share 3 simple methods to protect excel sheets from deleting.
Suppose we have a dataset of some Products and their sales date-wise. Now we are going to protect this worksheet from deleting.
1. Use Password to Protect Excel Sheet from Deleting
To protect the excel sheet from deleting the common and simple method is to protect user passwords. You can save a password for the sheet to protect it from deleting. Follow the steps-
- From the “Home” ribbon click on “Protect Sheet”.
- A new window will appear asking for a password to protect.
- In the “Password to unprotect sheet” provide a password of your choice and press OK to continue.
- Another window will open asking for the confirmation of the password.
- Type the same password you typed in the previous window.
- Click OK.
- This way you can protect your excel sheet from deleting with a password.
Read More: How to Protect Excel Sheet with Password
2. Activate Read Only Mode to Protect Excel Sheet from Deleting
When you want to restrict your file from deleting you may apply the read-only mode from the built-in tools option. In this method, I will show you a simple method to protect your excel sheet by applying read-only mode.
- Click the “File” option from the top of the workbook.
- Now select “Info” and choose “Always Open Read-Only” from “Protect Workbook”.
Thus you can make your excel sheet to read-only mode and restrict the file from deleting.
Read More: How to Protect Excel Sheet from Editing
- How to Protect Excel Sheet from Viewing Using Password
- Protect Excel Sheet but Allow Data Entry
- How to Protect an Excel Sheet Except for Certain Cells
3. Run a VBA Code to Protect Excel Sheet from Deleting
You can also run a VBA code to protect the excel sheet.
- Put the cursor on the sheet section and click the right button of the mouse to open Options.
- From the options go to “View Code”.
- The VBA window will open.
- In the new window, choose your sheet and then run the following code-
Private Sub Worksheet_Activate() ActiveWorkbook.Protect "123" End Sub Private Sub Worksheet_Deactivate() ActiveWorkbook.Unprotect "123" End Sub
- As you can see I have put the password “123” in the code. You can choose your own password and put it in the code section.
- Press Alt+Q to close the “Microsoft Visual Basic for Applications” window.
- Now shift to another worksheet and go back to the previous sheet to active the VBA code.
- Right-click on the sheet tab and you will see the “Delete” option is gray which means you can not delete the sheet.
So, applying this VBA code we have successfully protected our sheet from deleting.
- Excel VBA: Protect Sheet with Password and Allow Filter
- Excel VBA to Protect Sheet but Allow to Select Locked Cells
Things to Remember
- You might also need to unprotect the sheet after protecting the file with a password. To do that go to “Review” and select “Unprotect Sheet”. Now type the password and your sheet will be unprotected.
- You can also protect your whole workbook. Go to File > Info > Protect Workbook Structure > Password > OK.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
In this article, I have shown some easy methods to protect excel sheets from deleting. Take a tour of the practice workbook and download the file to practice by yourself. Hope you find it useful. Please inform us in the comment section about your experience. We are always responsive to your queries. Stay tuned and keep learning.