Hiding cells in a worksheet

Copper Contributor

Can you hide just a cell in a worksheet or can you only hide worksheets themselves.

And if you can only hide worksheets themselves does anyone have any recommendations on the best way to hide a small amount of information like the cost of a single item in a vehicle repair log?

5 Replies

@Jrktiger 

In Excel, you cannot hide individual cells directly, but you can use a few methods to effectively hide or obscure data in a cell. Here are some methods to hide a small amount of information, such as the cost of a single item in a vehicle repair log:

Methods to Hide Individual Cell Data

1. Change the Font Color to Match the Background:

  • Select the cell or range of cells you want to hide.
  • Change the font color to match the background color (e.g., white font on a white background).
  • This makes the data invisible, but it is still there if someone selects the cell.

2. Custom Number Format:

  • Select the cell or range of cells.
  • Right-click and choose "Format Cells."
  • Go to the "Number" tab and select "Custom."
  • In the "Type" field, enter three semicolons ;;; and click OK.
  • This custom format hides the cell contents but retains the data.

3. Hide the Column or Row:

  • If the data is in a column or row that can be hidden without affecting the rest of your worksheet significantly:
      • Right-click the column letter or row number.
      • Choose "Hide."

Hiding Worksheets

If you need to hide entire worksheets, you can:

1. Hide the Worksheet:

  • Right-click the worksheet tab you want to hide.
  • Select "Hide."
  • To unhide it, right-click any worksheet tab, select "Unhide," and choose the worksheet to unhide.

Protecting Sensitive Data

For sensitive data, it's crucial to ensure it is not easily accessible. Here are a few methods to protect sensitive information:

1. Protect the Worksheet with a Password:

  • Go to the "Review" tab.
  • Click "Protect Sheet."
  • Enter a password (optional) and select the actions you want to allow users to perform.

2. Use Very Hidden Property (VBA):

  • Open the Visual Basic for Applications (VBA) editor (press Alt + F11).
  • In the Project Explorer, find the worksheet you want to hide.
  • Set the worksheet's Visible property to xlSheetVeryHidden.
  • This method makes it so the worksheet cannot be unhidden via the Excel interface but can be unhidden through VBA.
  • Example VBA code:

Vba Code

Sub HideSheet()
    Sheets("SheetName").Visible = xlSheetVeryHidden
End Sub

3. Store Sensitive Data in a Separate, Hidden Worksheet:

  • Move the sensitive data to a separate worksheet.
  • Hide this worksheet using one of the methods above.

Example Scenario

For example, if you want to hide the cost of a single item in a vehicle repair log:

1. Using Font Color:

  • Select the cell containing the cost.
  • Change the font color to white (if the background is white).

2. Using Custom Number Format:

  • Select the cell containing the cost.
  • Apply the custom number format ;;;.

3. Storing in a Separate Hidden Worksheet:

  • Move the cost data to a separate worksheet named "HiddenData."
  • Hide the "HiddenData" worksheet using the "Hide" or "Very Hidden" method.

By combining these methods, you can effectively obscure or protect sensitive information in your Excel workbooks. The text and steps were edited with the help of AI.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.

Was the answer useful? Mark as best response and Like it!

This will help all forum participants.

@Jrktiger 

 

Can you hide just a cell in a worksheet or can you only hide worksheets themselves.

And if you can only hide worksheets themselves does anyone have any recommendations on the best way to hide a small amount of information like the cost of a single item in a vehicle repair log?

 

@NikolinoDE has given you a laundry list of ways to hide some things. I want to back up and ask for a bit more information here:

 

  1. What's the context? I.e., the bigger picture? Do you, for example, have a detailed sheet of all costs for a given repair job, and are wanting to print a higher level summary that doesn't show some details but still is accurate on the overall total? 
  2. You give the example of hiding a single item, but if this repair log has several (or many) individual items that you'd want to not display in detail, then it might make more sense to bunch the individual items but still on an invoice show "Miscellaneous Replacement Parts" or "Labor" that shows the total for the various details that fall into those categories.
  3. From whom are you hiding this data? (customer? middleman? other?) Is it safe to assume you're not trying to hide work that's been done; just to make an invoice (or other summary document) more "user friendly" by omitting the minutiae.

Hi, @mathetes

I have been asked to put together a maintenance log for our fleet and the owner was wanting to include the purchase price of each vehicles so it can also calculate depreciation. However he doesn't necessarily want everyone to be able to see how much they spent for them.

Thus the question about hiding just one or two cells.

Thanks for your help! 

Thanks for all the great ideas! I really appreciate your help!

@Jrktiger 

Let me assure you that everybody who has access to the workbook will know the purchase prices. No matter what you do to hide them.