This article will tell you how to unprotect an excel spread sheet without having the password

In case of a password protect worksheet you are unable to Edit the data on the Excel Sheet. If you do not Remember the Password or do not know the password to unprotect the sheet just follow the below simple steps.

 

Press ALT +  F11 or click on View Code in Developers Tabs

 

In the Above White Space Enter the below Code. Do not change the code just copy paste:

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

Now Click on the Run Button or press F5:

And there you go the sheet is unprotected for you now. Also you would be getting a message in the pop up window.

This Message is contains the password which can be used to unprotect the other sheets in the same workbook.

 


 Update:

Download sample file: PasswordBreaker

Also read:

Comments

        1. admin

          Hi Ray… Thanks for the comment…..
          In case the VBA Project is protected… you will need to copy the code to some other excel file and run the macro from the excel where the sheet is locked.
          Go to Developer Tab > Macros > Select the macro you copied to the other excel file and click on > Run
          Let me know if you have any questions. Thanks…

  1. Heinz

    Hi I cannot find the “enclosed example file with the new VBA Code”, the code posted above doesn’t work for me either

    1. Raghu R Article Author

      code works to unprotect a password protected worksheet (active). can you please tell me what is the error you are getting, a screenshot of error would be helpful.

      1. Waqar Hussain

        The Code also not working in my case. I’m trying to edit a password protected worksheet. When I run the code its continuous working and excel gets NOT RESPONDING

  2. B

    Thanks so much! I followed all the steps and typed in all the codes word for word exactly. And surprisingly it WORKED!!

  3. M

    Thank you SO much. This totally worked. One suggestion, why not just put the text in so people can simply copy and paste it as opposed to making people type it out. Anyways, thank you again.

  4. Sandesh

    It worked !! but there is a data loss in the sheet. So why there is a data loss? I see half of the records gets removed after running this.

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen + 2 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.