Excel.Tips.Net ExcelTips (Menu Interface)

Unlocking a Worksheet with an Unknown Password

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Unlocking a Worksheet with an Unknown Password.

Dennis has a travel expense worksheet that he has inherited; it has been passed down within his organization for years. Some of the cells in the worksheet need to be unlocked so that Dennis can correct the outdated formulas they contain. There is the problem, though: The worksheet is locked, and changing the formulas is not permitted because of the protection. Dennis wants to know how he can unprotect the worksheet so he can make the necessary changes.

Depending on the way that the worksheet was protected, you may be able to simply copy the worksheet contents to a new worksheet. Follow these steps:

  1. Create a new, blank worksheet. This can be in the current workbook or in a new workbook.
  2. Display the original worksheet that is protected. The first cell in the worksheet (A1) should be selected.
  3. Press Shift+Ctrl+End. Excel should select all the used cells in the worksheet. (If it doesn't, hold down the Shift key and press the arrow keys until you have selected all the worksheet cells.)
  4. Press Ctrl+C. This copies the selected cells to the Clipboard.
  5. Display the new, blank worksheet you created in step 1. Cell A1 should be selected.
  6. Press Ctrl+V. Excel pastes the contents of the Clipboard to the new worksheet.

The new worksheet can be changed in any way you need. If the old worksheet has links to other worksheets, you may need to copy those separately or establish those links manually. You will also need to adjust row heights and column widths, as necessary, to match the old worksheet.

If the above doesn't work, for some reason, you will need to actually try to crack the worksheet password. There are macros available, on the Internet, that will remove or identify any internal passwords, such as those used to protect a worksheet. If you do a search for "Excel password cracker" or something similar, you will find lots of candidates. The problem is that you'll also get lots of search results for programs that remove workbook passwords—something you don't need for this particular purpose.

Let me save you some trouble, however. There is a perfectly good internal password remover that is available at this page:


The page explains the macro (which is rather long) and even provides a download you can use, if desired.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2776) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Unlocking a Worksheet with an Unknown Password.

Related Tips:

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 4+5 (To prevent automated submissions and spam.)
          Commenting Terms

Comments for this tip:

ajith    15 Nov 2015, 01:50
I forgot the password a excell workbook created in 2003 version. so please assist to open the same.
Petros    27 Oct 2015, 05:05

You code won't work in Excel 2013 & 2016. You need this addin:

abhijeet    26 Oct 2015, 08:29
I have all files all sheets password break macro but i want run this macro for particular sheets so please tell me how to do this

Sub unprotect()
Dim ws As Worksheet, strWB As Workbook
Dim myPath As String, sFile As String

Application.ScreenUpdating = False
'Put this macro in folder remove that folder all files
'myPath = Application.ThisWorkbook.Path & "\"
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    myPath = .SelectedItems(1) & "\"
End With

sFile = Dir(myPath & "*.xl??")
If sFile = "" Then
    MsgBox "No CAF_File found!!!", vbCritical
    Exit Sub
End If

Do While sFile <> ""
    Set strWB = Workbooks.Open(myPath & sFile)
   'Run new macro
  Call AllInternalPasswords
   strWB.Close True
   sFile = Dir
Set strWB = Nothing

Application.ScreenUpdating = True
End Sub
Public Sub AllInternalPasswords()

Dim w1 As Worksheet, w2 As Worksheet
Dim i As Integer, j As Integer, k As Integer, l As Integer
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
Dim PWord1 As String
Dim ShTag As Boolean, WinTag As Boolean

Application.ScreenUpdating = False
With ActiveWorkbook
WinTag = .ProtectStructure Or .ProtectWindows
End With
ShTag = False
For Each w1 In Worksheets
ShTag = ShTag Or w1.ProtectContents
Next w1
If Not ShTag And Not WinTag Then

Exit Sub
End If

If Not WinTag Then

On Error Resume Next
Do 'dummy do loop
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
With ActiveWorkbook
.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 .ProtectStructure = False And _
.ProtectWindows = False Then
PWord1 = 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 Do 'Bypass all for...nexts
End If
End With
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
If WinTag And Not ShTag Then

Exit Sub
End If
On Error Resume Next
For Each w1 In Worksheets
'Attempt clearance with PWord1
w1.unprotect PWord1
Next w1
On Error GoTo 0
ShTag = False
For Each w1 In Worksheets
'Checks for all clear ShTag triggered to 1 if not.
ShTag = ShTag Or w1.ProtectContents
Next w1
If ShTag Then
For Each w1 In Worksheets
With w1
If .ProtectContents Then
On Error Resume Next
Do 'Dummy do loop
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
.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 Not .ProtectContents Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)

For Each w2 In Worksheets
w2.unprotect PWord1
Next w2
Exit Do 'Bypass all for...nexts
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
End With
Next w1
End If
MsgBox "Done"
End Sub
William Gendri    28 Sep 2015, 04:05
Thank you so much , for the information. the remove password works like a charm !
Hans    25 Sep 2015, 01:05
What can I say other than THANK YOU.
also to McGimpsey who kindly provides this Excel Add-In.
I can't understand why WOT (Web-of-Trust) bans the site at McGimpsey.
Colleen    15 Sep 2015, 12:28
I had a complicated Excel file come to me that needed some formatting changes and text updates. It was password protected, and I couldn't even select all the cells to be able to copy and paste. Fortunately, you came to my rescue!! Your macro worked perfectly. Saved me from hours of recreating the spreadsheet! Thank you.
Michael    28 Aug 2015, 06:11
The provided link worked like promoted (even on MAC) and just saved me a lot of copy and past work! Thank you Allen for the post and McGimpsey for the macro.

Off to do some actual work now ;)
mrstable    18 Jul 2015, 10:09
Help needed pls. I Hit Alt+F11 to view the Visual Basic Editor, I Hit Insert but no option was clickable including the module. so I can't hav access to where i wil paste the code. help pls...
Petros    14 May 2015, 05:04
The VBA code won't work if the sheets are protected in Excel 2013 or 2016 preview

Karicula    13 May 2015, 17:56
That was amazing - the VBA code worked perfectly the very first time to remove the password and took about 2 seconds.

Dave Tufte    07 Jan 2015, 16:45
I'm seconding Donald's post from December 23 about allInternalPasswords no longer working.

I'm running Excel 2013 in Windows 8.1.

I am getting this error even when all macros are enabled.

It's a pity. I teach a spreadsheet engineering class for MBAs. Most of the students end up as the Excel jock where they work, and this macro has been part of the toolkit I pass on to them for many years.
Gaya Prasad    05 Jan 2015, 05:53
Hi Dear,
 How protect formula that not show ant not copy formula
Donald    23 Dec 2014, 13:15
My apologies. I figured out my mistake in my execution of the macro. It worked GREAT!! Thanks!
Donald    23 Dec 2014, 13:07
I downloaded the workbook. Opened up the file in the new workbook. Went to add ins and then selected the macro. I received the following message. "Cannot run the macro "allinternalpasswords.xls!Allinternalpasswords. The macro may not be available in this workbook or all macros may be disabled." What do you suggest?
dave    15 Dec 2014, 10:44
When I CUT & PASTE from one worksheet to another the new, pasted version is numbers only, not formulae. This would be of no help in the present case of attempting to unlock formulae.

To copy formulae,on the original spread sheet I press CTRL~. (Tilde [~] is to the left of the number 1 at the top of the keyboard. Do CTRL~, not CTRL-SHIFT~.) This reveals formulae. COPY this spreadsheet. In the new workbook, PASTE SPECIAL/TEXT. That preserves the forumulae.
venkat    15 Dec 2014, 00:49
Thanks lot, it works nice. Grate job done.
Petros    27 Nov 2014, 05:02
Farhan Naseem Siddiqui    27 Nov 2014, 01:59
Wow you are superb... ! Greatyyy
Sarbabhowma.mondal    03 Jul 2014, 05:34
how to unlock excel password properly?
Matt Cotton    30 Sep 2013, 10:42
It could have been a LITTLE less confusing:
Follow the link above, check.
Download the workbook, check.
Open the workbook you want to unprotect, check.
Go to "addins" and click on "remove passwords", check.
Click "okay" through the pop up boxes.
Presto, all protection and passwords are removed, and it even tells you what (the derived) passwords are.
Makien    07 May 2013, 06:16
worked perfectly

Many Thanks
Julie Gervais    07 Apr 2013, 12:26
Thank you for a macro that was simple to use and worked the first time. I had tried several other programs that did not deliver as promised. There was a protected hidden sheet in a personal workbook I use and I needed to remove it from the workbook. This was the most simple method and I wish I had found it the first time I tried to remove the protected sheet. I simply copy and pasted the macro into my workbook, removed unnecessary script and voila! it worked.
Patrick    24 Oct 2012, 12:30
I had to use the hack and it worked. This is what happened. Running Office 2010. Have many spreadsheets opened. Opened a spreadsheet from customer (created in older version) with macros and protection, updated it and saved it. Closed out, the first sheet open after the protected one inherited the protection. Not the first time this has happened, nor does it happen all the time. I'll have to see if I can recreate it and post exactly when it happens. This was the fourth time, and the first time I found your site with the hack which worked. Thank you
Karen Crouch    16 Oct 2012, 10:41
when you go into the new sheet you could also do Paste Special to paste the column widths so you don't need to manually go and change them all.
Unfortunately there is now row height paste :-(

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2015 Sharon Parq Associates, Inc.