Note: The other languages of the website are Google-translated. Back to English

How to recover lost worksheet protection password in Excel?

We always set passwords to protect some important worksheets from being destroyed or modified by others. But if you forget your passwords, how could you do? Fortunately, Excel supports some VBA code to recover your lost worksheet protection password. You can deal with this problem as this:

Recover lost worksheet protection password in Excel with VBA code
More tutorial for protecting worksheet...


Recover lost worksheet protection password in Excel with VBA code

The following VBA code can help you to quickly cancel your original passwords in a worksheet.

1. Open your worksheet which has been protected before.

2. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following code in the Module Window.

VBA code: recover lost worksheet protection password

Sub PasswordRecovery()
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

4. Then click F5 key to run this code, and a prompt box will pop out, click OK to close it, and your passwords of the protected worksheet will be canceled at once.

Notes:

1. With this code, you just only recover one worksheet protection password at a time, if there are multiple protected worksheets, you need to apply this code one by one.
2. The above code comes from http://excelzoom.com/2009/08/how-to-recover-lost-excel-passwords/.


Easily protect multiple worksheets at the same time with password in Excel:

The Protect Worksheets utility of Kutools for Excel can help you protect multiple worksheets in bulk with the same password. It also provides the utility to unprotect these worksheets at the same time. Download the full feature 30-day free trail of Kutools for Excel now!


Related articles

How to protect multiple worksheets at once in Excel?

How to unprotect multiple worksheets at once in Excel?


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (95)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
pass recovery didn't work for me at excel 2013
This comment was minimized by the moderator on the site
Thanks!!! Works just fine with 2007 office
This comment was minimized by the moderator on the site
Superb!!!!!!!!! working fine.
This comment was minimized by the moderator on the site
Simple fix. Another case of "knowledge is power!" Thanks for sharing your knowledge to empower others!
This comment was minimized by the moderator on the site
Worked flawlessly. Knowledge is power, Thanks for sharing your knowledge to empower others!
This comment was minimized by the moderator on the site
Dear Team As per your words I did that and solved my problem but another problem is I have a excel sheet in which one sheet is password protected and when I press Alt+F11 and choose Insert Option there is disable of Moudle option so How can I retrieve it. Please suggest me.
This comment was minimized by the moderator on the site
Worked like a charm in Excel 2013!!! You're the best, thanks!
This comment was minimized by the moderator on the site
thank you so much!! it worked for me...
This comment was minimized by the moderator on the site
Thank You Chacha G (Google)
This comment was minimized by the moderator on the site
Thank You very much for the help almost give up earlier until i tried your method it works immediately thanks again
This comment was minimized by the moderator on the site
I opened the file I wanted to unprotect and was asked to enter password. I held down Alt+F11 keys and it dimmed my computer screen. I never got past that point.
This comment was minimized by the moderator on the site
I am using Microsoft Excel 2007 and when I opened the file that is protected it asked for the password which I forgot. When I hold down Alt+F11 at the same time the screen dims and I never got past that point.
This comment was minimized by the moderator on the site
Very Useful & timely Information. Thanks.
This comment was minimized by the moderator on the site
it works..... Thank you so much :-)
This comment was minimized by the moderator on the site
I can't thank you enough for your kind help. Best wishes.
This comment was minimized by the moderator on the site
What is approx run time for this? My machine is stuck for a while 30 min now.
This comment was minimized by the moderator on the site
Awesome. You are Genius
This comment was minimized by the moderator on the site
Awesome! Thank you for helping!
This comment was minimized by the moderator on the site
Awesome!!! Helped a lot :lol:
This comment was minimized by the moderator on the site
Thanks support. The world of the IOT is really changing our lives. Thank you!
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations