[Excel] How to ulock a protected Excel Worksheet, Step by Step

If you’re like me, you might have a tendency to forget passwords. I always have good intentions on trying to keep workbooks secure and the formatting and data stable, and sometimes those efforts fall flat when I forget the password. Or you might have gotten the worksheets from someone else and they’re might have forgotten the passwords, just like I do. So if you need to unlock the password protection on a worksheet here’s some quick and easy instructions on using a macro to help you unprotect the sheet.

Please don’t use these steps for unlawful purposes. Also these steps will only work for password protected sheets, which are the ones you can’t edit but you can still see the data on them.

For advanced users you can skip straight to the code on step 3.

Step 1: Press ALT + F11 on your keyboard to open up the Visual Basic Editor

Step 2: Click on [Insert] then [Module]

Step 3: Copy & Paste this code into the module window that pops up:

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 "One usable 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

Just like this:

Step 4: Go back to the password protected sheet and press ALT + F8

Step 5: Select the PasswordBreaker macro and click run.  It takes a little while to run, but it should do the trick!

Leave a comment ?


    Normally, I use a similar password for the models I create, so it’s easy to remember. I don’t know what I was thinking last time, the password defeated any logic and attempt.
    You saved me a lot of time!

  2. Awesome it worked..

  3. Thank you very much… this is a life saver!

  4. This was a life saver thanks! 😀

  5. This was a life saver thanks! 😆

  6. Truely life saver. I can recover my old excel formats where I have forgot the passwords.

  7. SUCH a huge help. We had a staff change and the former staff member had locked editing on an important reporting sheet. Worked like a charm. Thank you!!

  8. nice trick, thanks a lot

  9. You are a lifesaver! This totally worked! Thank you very much.

  10. It was great!

    Many thanks!! :mrgreen:

  11. Thank you SO much! Same thing for me – I usually use the same passwords, but for some reason didn’t this one time. This saved me so much time trying to recreate my workbook! Thank you!

  12. Thank you very much. It works fine.

  13. The most exciting macro I’ve used in ages! Saved me hours and hours of re-creating a spreadsheet. 😀

  14. Excellent – thanks so much – this works like a charm!

  15. Hii.. i only want to know the worksheet password. i dont want to break password. Please help

  16. Awesome! Saved me much embarrassment before a presentation!! 😳

  17. Does anyone of you knows how to improved this macro to work on more than one worksheet ?

  18. Love this. Saved my 3 hours time. Thanks a lot

  19. Very easy to do and it worked. Thanks

  20. Thanks very much!! I was trying to open a spreadsheet I did ten years ago.
    In two minutes the problem gone.

  21. It is really a very useful vba code, but when the VBA menu tabs are disabled by the developer how to find it as i could not access Step 1 and Step 2.

    Do the needful. Thanks

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>