How to Hide Worksheet Tabs in Excel Workbook

Posted on January 22nd, 2009 in Excel Howtos , Learn Excel - 18 comments

Reem, one of the PHD readers, asks in e-mail,

Is there a way to prevent users from unhiding “hidden sheets” in an excel file – without using VBA?

or to put it in other words, can the “Format/Sheet/Unhide” be disabled for specific worksheets?

Here is a non-VBA way to do this. I am not sure if this is optimum, but it seems to produce results without much effort. And it doesn’t use VBA, just the VBA Editor.

Step 1: Right click on the tab you want to hide and select view code option

Step 1: Right click on the tab you want to hide and select view code option

Step 2: In the properties window for that sheet, set “visibility” as 2 – xlSheetVeryHidden

Step 2: In the properties window for that sheet, set

Step 3: Now right click on the sheet name in project explorer area and select VBA Project properties

Step 3: Now right click on the sheet name in project explorer area and select VBA Project properties

Step 4: Go to “Protection” tab and check “Lock” project

Step 4: Go to

Step 5: and set password for protection, click ok

Step 5: and set password for protection

Step 6: when someone tries to open the VBA Code for that sheet to make the worksheet tab unhidden (visible), Excel prompts for a password

Step 6: when someone tries to open the VBA Code for that sheet to make the worksheet tab unhidden (visible), Excel prompts for a password

This trick is very handy when you are sharing workbooks with others and afraid that they may ruin the calculations or data.

| More
Excel School - Online Excel Training Program


Trackbacks & Pingbacks

Comments
Souri84 January 22, 2009

It’s a —- ! Not to hide a sheet but to protect VBA……. This protection is very easy to destroy and it’s not a real protection… Try Acyd.xla to convince you… you will see !

To download Acyd.xla, google it !

Chandoo January 22, 2009

@Souri: Welcome :)

I think you missed the step on changing the visibility to xlSheetVeryHide. Even if you do that and dont add VBA protection, you will be able to revert back the sheet by changing the visibility property. That is why you need to add VBA protection.

Of course, you can always break any type of protection using some crackware, that is not the point of this discussion though.
And, we would appreciate if you use a more acceptable language to share your enthusiasm.

derek January 22, 2009

Speaking of things you can (or can’t) do with an Excel worksheet tab; the other day I unconsciously reached for an affordance that wasn’t there. I was given a workbook with a confusing number of tabs on, so I thought “I know! colour coding them will make it easier to navigate” and went to change the colours of the tabs.

Of course Excel has no such capability, as I would have remembered if I wasn’t working in the morning before coffee. After all, Quattro Pro only had it twenty years ago.

Robert January 22, 2009

Derek,

I might be misunderstanding your question, but as far as I know Excel lets you change the color of the tabs already since Version Excel 2002 (right click on the tab and choose tab color).

Tim Mayes January 23, 2009

In Excel 2007, you can also disable that menu choice using RibbonX xml code. It isn’t secure, but the average user won’t have a clue how to unhide it.

Sumit Dhar January 23, 2009

Chandoo…

I have been visiting your blog for the past couple of months and I must say, it is superb. Each post is useful and I often use what you share at my work. Via your site, I have found quite a few other incredible excel blogs.

Next time you are in Bangalore, the coffee is on me. :)

Cheers,
D.

derek January 23, 2009

Oh, that’s good to know. Unfortunately I’ve only got 2000 at work. We were on the very brink of getting 2003 (not 2007!) when the recession hit and all our IT spending was cancelled.

Suryachandra January 24, 2009

Thank you Mr.Chandoo for giving many useful tips.I am so attached to chandoo.org,coz its beefing up my excel knowledge tank day by day.thanks a lot.

Chandoo January 24, 2009

@Suryachandra: You are welcome :)

Chandoo January 24, 2009

@Sumit, sweet.. free coffee. I might come to Bangalore in the next month or so for some work. :)

Chandoo January 24, 2009

@Tim: that is very good to know. Thanks for sharing it with us. But if we disable the menu choice using RibbonX code and send the workbook to someone else, wont they be still having access to the menu choice.. ?

Chandoo January 24, 2009

@derek: that means you have a stable version of excel at work for the next few years. no more wasting time with creating compatible versions and coping with new features.. :)

derek January 24, 2009

We were going to get a stable version. I was really impressed when I heard the upgrade was going to be to XP and Office 2003; I said “You can still get those!?”

That’s why I’m frustrated by the cancellation: we were so close to something that would stand good for many more years, and now who knows if we’ll be stuck with Vista and 2007 when the spending finally comes through? While everyone else moves on to whatever MS manages to salvage from the mess.

Sindhu April 9, 2009

Hi Chandoo,
I have an excel which is suppposed to have 3 sheets, but at one time only one sheet is visible.
Also, I cannot see any tabs.How the heck do I unhide all the sheets, make them visible at the same time, and how the hell do I get my tabs back.

-Sindhu

Chandoo April 14, 2009

@Sindhu: The excel workbook must be having “hide sheet tabs” option turned on. You can turn it off from excel options > Advanced options in excel 2007 or excel options menu item in excel 2003.

Also, it might be possible that the excel workbook has some macros which might be causing this behavior. In that case, turn off the macros and open the workbook again and you might be able to see all tabs.

Liliana June 7, 2009

I tried to set a pass for the code, but is not working. I´v tried on all of the sheets (7) on my workbook, I tried on the VBA project, but when i close and reopen, the pass is gone. And yes, i have save changes before closing.

Can anyone help me? Thanks.

Chandoo June 8, 2009

@Liliana… which version of excel you are using? The tip has been tested in excel 2003.

RSS feed for comments on this post. TrackBack URI

Leave a comment

   Name (required)

   E-mail (required, never displayed)

   URL


If you have a question, please ask in the forums

Recommended Excel, Charting, VBA books