Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Hiding and Protecting Columns.

Hiding and Protecting Columns

by Allen Wyatt
(last updated July 29, 2016)

4

Roger has a worksheet that he needs to distribute to different people so they can add and change some information. He wants to hide some of the columns in the worksheet, however, so that they cannot be viewed by users. He knows how to protect the worksheet and how to hide data in cells, but noticed that info is still visible in the formula bar. Since you already know how to protect a worksheet, you are already on your way to accomplishing your task. These are the steps you should follow:
  1. Select the column you want to protect.
  2. Press Ctrl+Shift+F. Excel displays the Format Cells dialog box.
  3. Make sure the Protection tab is displayed. (See Figure 1.)
  4. Figure 1. The Protection tab of the Format Cells dialog box.

  5. Make sure both the Locked and Hidden check boxes are selected. (It is the Hidden check box that controls whether the cell contents are visible in the formula bar or not.)
  6. Click OK to dismiss the dialog box.
  7. With the column still selected, display the Home tab of the ribbon.
  8. Starting in the Cells group, click Format | Hide & Unhide | Hide Columns. Excel hides the column.
  9. Again starting in the Cells group, click Format | Protect Sheet. Excel displays the Protect Sheet dialog box. (See Figure 2.)
  10. Figure 2. The Protect Sheet dialog box.

  11. Enter a password to be used in protecting the worksheet.
  12. Using the check boxes, select what type of protection you want applied to the worksheet. At a minimum you should choose Select Locked Cells and Select Unlocked Cells. (These two options are selected by default in a worksheet.)
  13. Click OK to dismiss the dialog box. You are prompted to reenter your password (the one from step 9), which you should do.
At this point someone cannot view what is in the hidden column, even if they use F5 to jump to one of the cells in the column; it still won't appear in the formula bar. There is one caveat to all this: If you have some cells in the worksheet (or workbook) that are unlocked, so that the contents of the cell can be changed, it is still possible to see what is in individual cells of the column. How? Two methods, really:
  • In the unlocked cell, enter a formula that references a locked and hidden cell. For instance, if column E is locked and hidden, entering the formula =E3 will display, in the unlocked cell, the value in cell E3.
  • Copy the contents of the locked and hidden cell and paste it in the unlocked cell. Use F5 to jump to the locked and hidden cell, then press Ctrl+C, move to the unlocked cell, and press Ctrl+V. The contents of the locked and hidden cell are pasted in the unlocked cell.
The bottom line is that it is virtually impossible to 100% protect the contents of the column so that they cannot be viewed. Using the protection features of Excel makes it more difficult, but a determined user may be able to still view the contents in the described manner.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8069) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Hiding and Protecting Columns.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Determining a Random Value

If you need to determine a random value in a macro, you can do so using the Rnd function. This tip presents the syntax and ...

Discover More

Customizing the Quick Access Toolbar

When you customize Word, the common place to make your changes is in the Quick Access Toolbar. This tip explains what the ...

Discover More

Setting the Calculation Default

Excel can recalculate your worksheets either automatically or manually. The default is to calculate them automatically, ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Preventing Someone from Recreating a Protected Worksheet

When you share a protected workbook with other people, you may not want them to get around the protection by creating a new ...

Discover More

Checking Lock Status of Cells

When you first create a worksheet, all the cells in that worksheet are formatted as locked. As you unlock various cells on ...

Discover More

Automatically Protecting After Input

Do you want user-entered data to be immediately protected so that it cannot be changed? This can be done relatively easily ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 - 0?

2016-08-01 22:16:58

Alec Whatmough

Another, and better option if you really need sensitive data in your workbook and really don't want people viewing it, is to put that data in a separate sheet, then make that sheet Very Hidden. As above, hidden columns are easy to get around, but very hidden sheets require expert hacking.
Just be sure to password-protect your vba project for the workbook, otherwise your efforts may be in vain.
http://www.spreadsheet1.com/very-hidden-sheets-xlsx.html


2016-07-29 07:13:47

Dave

Kynt:

I would be very grateful if you could send me your macro code to get around password protection. I fell into the trap of not making a proper note of the pw and, oops, you can guess the rest!


2015-11-10 13:48:42

erickham

protect shared worksheet
I have created an excel sheet which was shared among multiple users who need to edit an assigned column with password protection so that other could not modify their entry. the idea is that each person will have to enter his password to unprotected/protect an assigned column in the shared sheet. But after sharing the sheet, protect sheet option under Review became inactive making it difficult to unprotected the column and edict it. What should I do? Please help! Thanks!


2015-02-19 14:15:59

Kynt

You can use the Data Validation option to control what can be entered into the unlocked cell. However, the content of a locked and hidden cell can still be read via referencing from a different excel sheet/workbook. Also, the password protection can be easily cracked with a simple macro.

Never, ever rely on sheet/workbook protection to hide sensitive data. It's really only useful to make spreadsheets more user-friendly and to prevent users from accidentally messing up a carefully crafted spreadsheet.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.