excel2007.Tips.Net Welcome toExcel2007.Tips.Net

Helpful Links

Excel 2007 Home
Tips.Net Home

Ask a Question
Make a Comment

Excel2007 Tips
Family Tips
Pest Tips
Pet Tips

Newest Tips

Changing a Link's Source

Using Conditional Formatting to Shade Rows

Editing by Moving and Copying

Making Sure Duplicate Names Aren't Entered

Applying a Conditional Format to a Full Row

Hiding Worksheet Tabs

Making Cells Flash

 

Hiding the Contents of Cells

Summary: Hiding information in one or more cells can be a challenge. This tip presents several different techniques that can help you keep information from being displayed.

Ruby has a worksheet that she needs to print out in a couple of different ways for different users. Part of preparing her data for printing involves hiding or displaying some rows and some columns, as appropriate. Ruby wondered if there was a way to hide the contents of individual cells, as well.

If, by "hide," you want to have the cell disappear and information under it move up (like when you hide a row) or move left (like when you hide a column), then there is no way to do this in Excel. Actual hiding in this manner can only be done manually, on a row or column basis.

There are ways that you can hide the information in the cell, however, so that it doesn't show up on the printout. One easy way, for instance, is to format the cell so its contents are white. This means that, when you print, you'll end up with "white on white," which is invisible. Test this solution, though—some printers, depending on their capabilities, will still print the contents.

If this approach works for you, you could expand on it just a bit to make your data preparation tasks just a bit easier. Follow these general steps:

  1. In an out-of-the-way cell (let's say it is cell J1) insert the letter "p."
  2. Select the cell (or cells) you want to hide on the printout.
  3. With the Home tab of the ribbon displayed, click the Conditional Formatting option in the Styles group. Excel displays a palette of options related to conditional formatting.
  4. Click New Rule. Excel displays the New Formatting Rule dialog box.
  5. In the Select a Rule Type area at the top of the dialog box, choose Use a Formula to Determine Which Cells to Format. (Click here to see a related figure.)
  6. In the criteria area for the rule enter the following: =J1="p". This formula will return True if the cell contains a lowercase letter "p."
  7. Click the Format button. Excel displays the Format Cells dialog box.
  8. Make sure the Font tab is displayed. (Click here to see a related figure.)
  9. Use the Color drop-down list to choose white.
  10. Click OK to dismiss the Format Cells dialog box.
  11. Click OK to dismiss the New Formatting Rule dialog box.
  12. Print your worksheet as normal. The cell contents should not show up on the printout.
  13. To make the cell contents visible on the printout, just modify cell J1 so that it contains something other than the letter "p."

Another solution is to use a custom format for the cells whose content you want to hide. Follow these steps:

  1. Select the cell (or cells) you want to hide.
  2. Choose the Cells option from the Format menu. Excel displays the Format Cells dialog box.
  3. Make sure the Number tab is displayed. (Click here to see a related figure.)
  4. In the list of format categories, select Custom.
  5. In the Type box, enter three semicolons (;;;).
  6. Click on OK.

Now the information in the cell is not visible, nor will it print. You can, however, see the information in the Formula Bar, and it can be overwritten if you enter anything else in the cell.

Related Tips:

Save Time! WordTips has been published weekly since early 1997. Past issues are available in convenient WordTips archives. Have your own enhanced archive of WordTips at your fingertips, available to use at any time! Check out WordTips Archives today!