You are here:

Excel/Password Protect Individual Sheets


Ross wrote at 2009-04-24 00:12:10
This does work, but then all you need to do is run the debugger and it allows you to read / edit the script and see the password.

Rain wrote at 2009-06-05 23:29:38
That was my initial reaction, but if you have another Tab with name '("OkToSeeThisOne") as mentioned in the previous reply then the debugger does not show up - unless I am missing something here.

This was an excellent solution. Thanks !

Rain wrote at 2009-06-09 22:59:48
Would like to append to my earlier response - If you open the Spreadsheet and select 'Disable Macros' then this does not work as desired.

dvv wrote at 2010-01-14 12:40:13
problem is if the end user also right-clicks on the sheet and selects view code he can see this code with the password in it

Pookie wrote at 2010-12-01 12:29:24
This is fantastic.  We publish workbooks on Share Point & have constant issues around confidentiality of data.  This has circumvented my problem completely.  

Many thanks.

hardingdvd wrote at 2011-05-04 16:07:46
Unfortunately this solution has a little bug that allows viewing of the sheet anyway if you hold down the mouse button and don't release it. As long as you continue to hold the button, you can read the contents of the sheet.

Moses wrote at 2011-10-25 20:48:18
FYI ... this works however all users must have macros enabled.  If a user doesn't have macros enabled, he/she will be able to see all of the sheets.  

Neron_PWSFTvT wrote at 2012-06-08 09:59:51

Nice one - but if you click cancel and not put any password, you can still see the tab that supposed to be locked ???  

Sol Gypsy wrote at 2013-02-18 09:33:16
Hi, I've been googling for ages to get help with this code.  The code you've provided does exactly what I require.  If someone puts in the wrong password however you can't get back to the original tab.  I had to close excel & open the spreadsheet up again.  

Do you know what coding would take you back to the original tab if the wrong password is entered?

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Bob Umlas


I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at


Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Excellence, The Expert, Microsoft

BA in math, Hofstra University, 1965

Awards and Honors
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2017 All rights reserved.