How to protect and unprotect Excel sheet with or without password

The tutorial shows how to protect Excel sheet with or without passwords. It also explains how to unlock Excel spreadsheet without password if you forgot or misplaced it.

When sharing your worksheets with other people or sending your Excel files outside of your organization, you may want to prevent other users from changing cells that shouldn't be changed, and also from moving or deleting important data in your worksheet or workbook.

Luckily, Excel provides a quick and easy way to lock a sheet or password protect an entire workbook to prevent accidental or deliberate changes in their contents.

What you need to know about Excel worksheet protection

Worksheet protection in Excel is not a security feature. It's is not actually intended to prevent people from accessing data in a password-protected worksheet. Why? Because Microsoft Excel uses a very simple encryption algorithm for worksheet protection. Even when you protect your Excel worksheet with a password, that password is very easy to break.

In older versions (below Microsoft Excel 2010), it doesn't even matter how long and complex your password is. Anyone who has at least some basic knowledge of VBA can crack it in minutes (here's an example of the VBA code that easily cracks passwords in Excel 2010 and lower versions).

The recent versions of Excel 2013 and 2016 use more sophisticated methods of sheet protection, but they are also vulnerable and can be unlocked without knowing a password. In other words, if someone really wants to get access to a protected sheet, they will.

So, does this mean that Excel worksheet protection is absolutely pointless? Not at all! It makes sense to lock Excel sheets to avoid accidental changes in the sheet contents. A common example is Locking formula cells to prevent inadvertent erasure or modification of formulas.

The bottom line is - lock an Excel spreadsheet to prevent other users from accidentally tampering with your data, but never store sensitive information in your Excel sheets.

If you strive to ensure the maximum security protection for your Excel files, be sure to do all of the following:

  1. Use the modern versions of Excel 2010, Excel 2013, and 2016 with enhanced data encryption mechanisms.
  2. Protect your sheets with strong passwords that include different types of alpha numeric characters and special symbols. At that, try to make passwords as random as possible, for example by using our password generating tool.
  3. Protect the workbook structure to prevent other people from adding, moving, renaming, deleting or unhiding your sheets.
  4. For workbook-level security, encrypt the workbook with different passwords from opening and modifying.
  5. If possible, store your Excel files with sensitive information in a secure location, e.g. on an encrypted hard drive.

How to protect Excel sheet

To protect a sheet in Excel 2016, 2013 and 2010, perform the following steps.

  1. Right click a worksheet tab at the bottom of your screen and select Protect Sheet… from the context menu.

    Or, click the Protect Sheet button on the Review tab, in the Changes group.
    Protecting a sheet in Excel

  2. In the Protect Sheet dialog window, do the following:
    • To password protect your Excel sheet, type a password in the corresponding field. Be sure to remember the password or store it in a safe location because you will need it later to unprotect the sheet.
    • If the worksheet protection is nothing more than a precaution against accidental modification of the sheet contents by yourself or by the members of your local team, you may not want to bother about memorizing the password and leave the password field empty. In this case, unprotecting the sheet takes just a single click on the Unprotect Sheet button on the ribbon or in the sheet tab's right-click menu.
    • Select the actions you allow the users to perform.
      • By default, the following 2 options are selected: Select locked cells and Select unlocked cells. If you leave only these two options selected, the users of your sheet, including yourself, will be able only to select cells (both locked and unlocked).
      • To allow some other actions such as sorting, filtering, formatting cells, deleting or inserting rows and columns, check the corresponding boxes.
      • If you don't check any action, users will only be able to view the contents of your Excel sheet.
    • Click the OK button.

    Type the password (optional) and choose the actions you want to allow your users to perform.

  3. The Confirm Password dialog box will pop-up prompting you to retype the password so that an accidental misprint won't lock your Excel sheet forever. Retype the password and click OK. Done!

How to unprotect Excel sheet

As you have just seen, it's very easy to password protect a sheet in Excel. Unprotecting a spreadsheet is even easier, provided that you know the password. Though, unlocking an Excel spreadsheet without password is no big deal either :)

How to unprotect Excel sheet with password

If you know the password for the protected sheet, removing protection is a matter of seconds. Just do any of the following:

  • Right-click the sheet tab, and select Unprotect Sheet… from the context menu.
    Unprotecting an Excel sheet with password
  • On the Review tab, in the Changes group, click Unprotect Sheet.
    Another way to unprotect an Excel sheet with password
  • On the Home tab, in the Cells group, click Format, and select Unprotect Sheet from the drop-down menu.
    One more way to unlock an Excel spreadsheet with password

If you are dealing with a password-protected worksheet, Excel will ask you to enter the password. Type the password and click OK.

If the worksheet was not protected with password, clicking the Unprotect Sheet button is all it takes to unlock the sheet.

How to unprotect Excel sheet without password

As mentioned in the beginning of this tutorial, Excel worksheet protection is quite weak even in the recent versions of Excel 2013 and Excel 2016. If you need to edit a password protected sheet but you cannot remember the password, try to unlock that Excel spreadsheet by using one of the following methods.

Unlock Excel spreadsheet with VBA code (for Excel 2010 and lower)

If you are using Excel 2010 or older version, you can unlock a password-protected sheet with the following macro.

  1. Open your Excel document and switch to the password-protected sheet (it should be active when you run the macro).
  2. Press Alt + F11 to open the Visual Basic Editor.
  3. Right-click the workbook name on the left pane (Project-VBAProject pane) and select Insert > Module from the context menu.
  4. In the window that appears, paste in the following code:
    Sub PasswordBreaker()
    			'Breaks worksheet password protection.
    			Dim i As Integer, j As Integer, k As Integer
    			Dim l As Integer, m As Integer, n As Integer
    			Dim i1 As Integer, i2 As Integer, i3 As Integer
    			Dim i4 As Integer, i5 As Integer, i6 As Integer
    			On Error Resume Next
    			For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
    			For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
    			For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
    			For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
    					ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
    							Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
    							Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
    					If ActiveSheet.ProtectContents = False Then
    							MsgBox "Password is " & Chr(i) & Chr(j) & _
    									Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
    									Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
    							Exit Sub
    					End If
    			Next: Next: Next: Next: Next: Next
    			Next: Next: Next: Next: Next: Next
    	End Sub
  5. Press F5 or click the Run button on the toolbar and wait a couple of minutes.
  6. The macro will report a cracked password, which is not the original one (always some combination of A's and B's), but nevertheless it works. You do not need to remember this fake password or enter it anywhere. Simply click OK and the sheet is unprotected!
Tips and notes:

  • If your Excel file contains more than one protected sheet, run the macro for each sheet individually to unprotect it.
  • To unprotect Excel sheet without password in the modern versions of Excel 2019, Excel 2016 and Excel 2013, you can save the document as Excel 97-2003 workbook (*.xls) first. Then, close Excel and reopen the workbook - it will be opened in compatibility mode. Run the macro to unprotect the worksheet, and then save the workbook back as an .xlsx file. Alternatively, you can use one of free tools, for example Password Protection Remover add-in for Excel. Or you can upload the protected Excel worksheet to your Google Drive, and then open it with Google Sheets (thank you for the tip, Kanan!).
  • In case you are not very comfortable with VBA, you can find the detailed guidance in the following tutorial: How to insert and run VBA code in Excel.

Copy the protected sheet contents to another worksheet

Another way (or rather a workaround) to unlock an Excel sheet that was protected with password is to copy its entire contents to a new sheet. Here's how:

  1. Open the password-protected sheet.
  2. With the cursor positioned in cell A1, press Shift + Ctrl + End to select all used cells in the worksheet.
  3. Press Ctrl + C to copy the selected cells.
  4. Create a new sheet in the current workbook or in a different workbook (to create a new Excel file, simply press Ctrl + N).
  5. In the new blank worksheet, place the cursor in A1 and press Ctrl + V to paste the contents of the password-protected sheet.

  • This method works only if the Select locked cells and Select unlocked cells actions are allowed in the protected spreadsheet.
  • If the password-protected worksheet has external links to other sheets or workbooks, you may need to re-create those links manually.
  • You can use Paste Special to copy / paste the column widths so you won't need to adjust them in the new sheet manually.

How to protect a workbook in Excel

Apart from protecting the sheet contents, you may also want lock the entire workbook to prevent users from adding, moving, renaming or deleting worksheets, and viewing hidden sheets.

To protect the workbook, perform the following steps:

  1. On the Review tab, in the Changes group, click the Protect Workbook button.
    Protecting a workbook in Excel
  2. Under Protect workbook for, select one of the two options, or both:
    • Check the Structure box to protect the structure of a workbook. This will prevent the following actions:
      • Viewing hidden worksheets.
      • Renaming, moving, hiding or deleting sheets.
      • Inserting new sheets and chart sheets. However, users will be able to insert a chart in an existing worksheet.
      • Moving or copying sheets to another workbook.
    • Check the Windows box to retain the size and position of workbook windows. This will prevent users from moving, resizing, minimizing, or closing the workbook windows.
      Protecting the workbook structute

      Note. The Windows option is not available (greyed out) in Excel 2013 and Excel 2016, as shown in the screenshot above. It is because Microsoft introduced the Single Document Interface in Excel 2013, where each workbook has its own top-level window that can be minimized, restored, and closed.
  3. In the Password box, type a password, and click the OK button.
    As indicated on the dialog window, a password is optional. However, if you do not enter a password, then anybody will be able to unlock your workbook with a button click.
  4. Retype the password in the Confirm Password window and click OK. That's it!

How to unlock a protected workbook in Excel

To remove the workbook protection, do the following:

  1. Click the Protect Workbook button again (in a locked workbook, it is highlighted in green like in the screenshot below):
    Removing the workbook protection in Excel
  2. Type the password if prompted.
  3. Save the workbook.
Important note! Protecting the workbook structure should not be confused with workbook-level password encryption that can prevent other users from opening or/and modifying your workbook. If you are interested in this level of workbook protection, check out the next sections of this tutorial.

Password protect Excel workbook from opening

If you store your workbooks in a shared location such as a company local network, and you want to prevent other users from viewing your Excel files, you can encrypt your workbook with password that won't even let other people open it.

  1. In the workbook you want to encrypt, click File > Info, click the Protect Workbook button, and select Encrypt with Password in the drop-down menu.
    Select the 'Encrypt with Password' option to protect your Excel workbook from opening.
  2. The Encrypt Document window will appear, you enter a password in the Password box, and click OK.
    Enter a password to open the workbook..

    By default, Microsoft Excel uses AES 128-bit advanced encryption, and you can supply a password up to 255 characters.

  3. Retype the password in the Reenter password box, and click OK.
  4. Save your workbook.

To remove the workbook encryption, repeat the above steps, delete the password from the Password box, click OK, and then save your workbook.

Tip. In addition to password-protection, you can secure your Excel files further by using the BitLocker Drive Encryption, which is available in the Ultimate and Enterprise editions of Windows Vista and Windows.

Password protect Excel workbook from modifying

If you don't mind other users opening your Excel file but you want to prevent them from making any changes to your workbook, perform the following steps.

  1. In your Excel workbook, click the Save As button, and then click the Tools button at the bottom of the window.
  2. In the Tools drop-down menu, select General Options.
    Password protect Excel workbook from modifying.
  3. In the General Options dialog window, type a password in the Password to modify box. Additionally, you can select the Read-only option, which is recommended.
    Type a password in the 'Password to modify' box.

    Tip. If you want to protect your Excel file both from modifying and opening, type the passwords in the Password to open and Password to modify boxes. It can be the same password of two different ones.
  4. Retype the password in the Confirm Password dialog, and click OK. If you've entered 2 passwords in the previous step, you will be asked to confirm both.
  5. Finally, click the Save button in the Save As dialog.

To remove the password protection, repeat the above steps, and delete the password(s) from the Password to open and Password to modify boxes. Then click the Save button to save your workbook.

This is how you can protect an Excel sheet and lock the entire workbook from changing or opening. However, sometimes you may not want to go that far and rather lock only certain cells in your sheet. And this is exactly what we are going to discuss in the next article. I thank you for reading and hope to see you on our blog next week.

321 responses to "How to protect and unprotect Excel sheet with or without password"

  1. Maz says:

    Great job!! Thumbsup

  2. Vinayak Kasbekar says:

    I have run the above code for unlocking excel sheet, its work for 1 file but its not working for another file. Please help to unblock the same.

    • charles says:

      Go back to the open Excel workbook, and switch to the next sheet before running the next code. This worked for me.

  3. Jannine says:

    Hi, I am trying to unprotect an excel document without knowing the password. It has been saved in excel 2010 and I have tried copying and pasting your password breaker code but I get an compile error - sub or function not defined.

    Any ideas why this is happening?

    • Mono says:

      i already try, and no need to type the password. after run (password was remove too, but only one sheet. so we need to do same thing many time for all sheet)

    • Keith says:

      what was the answer.... were you able to get past that error? I have the same

  4. Nurul haque says:

    how setting unprotected of excel sheet

  5. Nurul haque says:

    how setting protection of excel sheet

  6. edz says:

    It works, thanks for this very useful and educative information.

  7. Arun N Kumar says:

    Very helpful blog.. Thank you so much Guys

  8. abhishek bhatt says:

    I am trying to crack password but process is not completed .Not found any password or error. process is stuck.

  9. Javeed says:

    Works like a charm for me. Thank you!

  10. Reddcliffe says:

    Great article! if you have a version that is newer than 2010 you can try "save as" as a 2003-2007 workbook, then run the macro to unlock and then "save as" back to version you want. Worked for me.

    • Phantomsteve says:

      This worked perfectly! I had a 2016 workbook, so saved as "2003-2007 Workbook", ran the macro on all the sheets, then saved as the original version, overwriting it. I then made sure that I noted the password that I used for the sheets, before re-protecting it!

      Thank you very much, Reddcliffe :)

  11. Anish P says:

    Thank you very much madam

  12. chethan says:

    when try to run this code excel workbook is not responding could you please help

  13. Shafqat Hussain says:

    Nice information. Thank you

  14. Nakul says:

    wow it's amazing yaar very good thanks for sharing this information

  15. Manjunatha G says:


    Many thanks it works very easily and really use full

    Again Thanks

  16. Dilpreet Singh says:

    Actually Very Nice information. I opened password Protected Excel file in just 5 min using your techniques.Thank You.

  17. Joseph says:

    Genius !!

  18. OBDonone says:

    How can you run the code if you cannot open the file?

  19. Chrisostam Philip says:

    your direction to open VBAProject(*.xls) Password protected sheet didn't work. I have attempted open a Password protected sheet which used excel 2007. After you right click on the VBAProject I was able to see Insert option but Module part is grayed out not available to insert the code mentioned. :(

    When you have a chance please reply.

    • John says:

      save your file as 97-2003 version, follow the process as mentioned in: Unlock Excel spreadsheet with VBA code (for Excel 2010 and lower)
      Then the password should be removed.
      simply save the file back to 2007 or higher version.

    • Mohammed Sadiq says:

      Double click on the worksheet so that i displays to enter the code. Just copy and paste the code there it works fine.

  20. MP says:

    Awesome! Thank you.

  21. YTFHG says:


  22. Rashid says:

    You rock. Thanks so much for sharing this information!

  23. Don Wenski says:

    How do you open a workbook for which you forgot the password?

  24. Gokhan says:

    These tips really worked for me. I was able to unlock a spreadsheet just based on these steps. Thanks

  25. Will says:

    Nice article, just wanted to tell the Author great job on helping me crack this stupid workbook

  26. Adane says:

    Thanks a lot. I found the VBA code a good solution for me.

  27. Bhikaji Moraskar says:

    How to unlock excel

  28. Sheila says:

    Will this work for a word document?

  29. Zaahira says:

    I am trying to unprotect a workbook but it is not letting me with the above methods. When I click on file, the protect workbook button is highlighted in yellow and if I click on it just wants to make further protection

  30. bob says:

    thank you!

  31. Poonam says:

    Very informative

  32. Someone says:

    This is ridiculous. In "Copy the protected sheet contents to another worksheet", it fails to say that you cannot highlight locked cells, which if someone has the know-how to lock the sheet, they will most likely have locked certain cells/columns/rows. Therefore you can only highlight up to the next locked cell, which if column B, will highlight only A1. Pretty useless.

  33. Balaji says:

    This is awesome. Thanks a ton!!

  34. S V Pathak says:

    It really worked. Thanks a lot

  35. Jason says:

    thank you

  36. nasir says:

    Hi, I wanted to in-protect workbook, I tried all the options but not worked, file saved in Excel 2013

    Kindly help

  37. Munawar says:

    Thanks a lot...

  38. ali says:

    i forgot my pass what should i do?

  39. Vikas Jha says:

    How to unlock workbook password if I forgot the password

  40. C says:

    This is helpful, thanks for the post!

  41. Tharindu Manathunga says:


    it is very worth for me


  42. ahmad says:

    thank you it was very easy and perfect

  43. Mark says:

    Does this work for Excel 2013 and 2016? If not, is there tutorial available for these versions?

  44. Alex says:

    My excel workfile (2013) is password protected for open.
    No problems with this.
    However in some unknown way my workbook structure has become protected (meaning I can't add a new worksheet etc.) When I try to add a new worksheet by clicking on the + symbol at the end of all the worksheet tabs - the + symbol is greyed out.
    Any solution to this would be appreciated.
    I'm hoping to avoid the slow solution of copying all the worksheets individually to a new workfile.
    I am very hesitant to download any non Microsoft software to unprotect my workfile and MS don't provide any support in this area.

    • Alex says:

      (just replying to my own post).
      I have now given up on this and taken the slow solution by copying all my worksheets to a new workfile.

  45. Asritha says:

    Its not extra-ordinary. Its average. Its OK

  46. J says:

    I am trying to unlock a password protected workbook. I saved in 97-2003 excel, then went to view code. A pop-up saying, VBAProject Password. I clicked cancel, received a system error, clicked ok. Module is greyed out. I tried to copy the code referenced and paste but it will not allow me to paste. Please help

  47. Nikhil Kalra says:

    Thank you! worked like a charm!!!

  48. ASHUTOSH says:

    Ablebits, Thank you so much for this article. Extremely helpful.

  49. NM says:

    Excellent Information, :)
    Thanks a ton !

  50. Amit das says:

    I have forgot my excel sheet password so how to remove the same?

  51. Alyssa Mancio says:

    I forgot the pw and my Excel in Version Microsoft 2013

  52. jose nicholas says:

    thanks a lot, so helpful

  53. Iverson Yang says:

    thanks, I have a question. If I forgot password which any sheet hidden, What should I do ?

  54. Any says:

    So simple and easy to break the password work college put on sheets to be clever, clever and play Mr Important over us. Except he left the company without giving us the passwords. Now that IS clever, clever!

  55. imrann says:

    Very helpfull guide

  56. Toff says:

    It works! Thanks!

  57. MAK says:

    I have an excel file but i forget the password and i am unable to open this file. can anyone help me?????

  58. mubarak says:

    now i have my meal, paid work for 1 minute work, thanks very helpful article.

  59. Godwin says:

    Very helpful blog.. Thank you so much Guys

  60. deepak makhijia says:

    Thanks a lot, so very helpful

  61. James Napper says:

    Just to say, this tip was a life saver today, thanks so much!

  62. Dindayal Jangid says:

    very good its help and i re generate the password

  63. Sagar says:

    Hey i got all the steps correctly & got the password also but when i press "okay" it goes back to the VBA page & doesn't open - please help.

  64. sobel barua says:

    i m forget the password Excel-10 version and can't change the content what are the protected. how can i unprotect this file without password.

  65. sobel says:

    i m forget the password Excel-10 version and can't change the content what are the protected. how can i unprotect this file without password.pls help to advise on this.

  66. Pawan Sharma says:

    Hallo Sir/Mem
    I'M Pawan
    Mujhe ye janna hai ki hum jese excel me sheet ko protect kar ke rakhe hai aur uska password forget ho chuke hai to use dubra open kese kru please reply me

  67. jad says:

    how to remove the protect sheet and protect workbook.
    i don't want to protect my workbook or my sheet at all anymore.
    i have the password. i tried what i know but still requesting password to unprotect my sheet or my workbook.
    thank you a lot in advance

  68. Abdalla Ebrahim says:

    Thank you so much ... It really works like a charm.

  69. KRUSHNA says:


  70. yo says:

    When I do this I get a "Not responding" error.

  71. Mercedes says:

    How to unlock a cell with data validation?

  72. himanshu says:

    thank you so much

  73. John says:

    Huge help. Thanks.

  74. Pawel says:

    Thanks a lot! :)

  75. Vinay says:

    Fantastic article and saved me from a massive headache.
    Thank you!!

  76. king rocker says:

    This is BS it says AAAAAAA... at all files and of course it doesn't work

  77. Murtuza says:

    You sir are a genious!

    The script worked, and I unlocked my managers excel and modified it and locked it back :-D

  78. david says:

    my macro interface is also protected...

  79. chitrita says:

    if in the inset option the module option is disabled what to do on that case .

  80. Joe says:

    I was given a protected Excel file, that I needed to use the logic in, for my project at work. But I wasn't given the password! (I don't think anyone else knew it either.)

    Thanks so much for the section on getting in a protected sheet. Now I can get on with my task. :)

  81. Juliette says:

    How long should it take after you run the macro? I continue to get the blue circle of thought and a 'not responding' message in my header bar.

    • Edh says:

      Getting same. This used to work very quickly, but now it appears to hang... Going to let it run overnight and see what happens.

  82. JOhnson says:

    Thank you very much!

  83. Pappu Saha says:


  84. Joana Costa says:

    Worked like a charm! Thank you!!!!

  85. ruthie says:

    i have an excell that has many hiddensheets; in the VBA i am able to see the tree, but it would let me change to visible to unhide the sheet... its blocked...

    i tried the pass word cracker...that is not working. still can see the sheets... any ideas?

  86. Connor says:

    Doesn't work!!
    Any ideas?

  87. Salman Hyder says:

    Very useful and effective article. Solve my problem of unlocking sheet without password


    wow it's amazing yaar very good thanks for sharing this information

  89. Bugarov says:

    That's been a lifesaver thank you so much.

  90. Richel says:

    Thank you so much! Such a great help. You're the best

  91. slai says:

    thanks for the info, it worked

  92. lj_camp says:

    very good. it works fine!

  93. Rasel says:

    Great job, but I need to know excel sheet open password breaker. Please help me dear.

  94. akshay goyal says:

    It works after converting the excel to 97 format.

  95. Bilal Antulay says:

    please tell me if the insert command is not activating what to do.

  96. forgot to password says:

    Dear Sir ,
    my excel sheet password to forgot .
    please how to unprotected excel sheet

  97. Chirag Sinojiya says:

    Hello Sir..
    It was Amazing.. Thank you so much for your support.. It really made my work easy..

  98. Mina says:

    Many thanks! It works!
    I'm using the MS Office 2013. I converted the file to lower version of excel and copied the code and resolved the issue.

  99. Ana Bleta says:

    You are the best!
    It worked.

  100. Gen-Issao says:

    I am impressed too much with the explanation. It's quite explicit and simple to understand.
    I am a DATA ANALYST, but I never knew that, one can unlock a PASSWORD SHEET without a PASSWORD...

    thanks pretty much....


Post a comment

Thank you for your comment! When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to your query. We cannot guarantee that we will answer every question, but we'll do our best :)