Excel Guides

Hiding Objects in Excel

There are a few ways to hide objects in Excel. One way is to use the Hide option in the Format Cells dialog box. To do this, select the cells you want to hide, then go to the Home tab and click Format > Format Cells. In the Format Cells dialog box, go to the Protection tab and check the Hidden box. You can also use a custom number format to hide cells. To do this, select the cells you want to hide and go to the Home tab. Click Format > Number > More Formats. In the Format Cells dialog box, go to the Custom category and enter ;;; (three semicolons) in the Type box. This will hide anything that's entered into those cells.

Another way to hide objects in Excel is by using conditional formatting. With conditional formatting, you can create rules that will automatically format cells based on certain conditions. To do this, go to the Home tab and click Conditional Formatting > New Rule. In the New Formatting Rule dialog box, select Use a formula to determine which cells to format. In the Format values where this formula is true text box, enter a formula that will return TRUE when the cell contains a value you want to hide. For example, if you want to hide all cells that contain the word "hidden", you would enter =ISNUMBER(SEARCH("hidden",A1)). Click Format, then select the font color you want to use for hidden cells (typically white), then click OK twice.

You can also use VBA code to hide objects in Excel. To do this, open the Visual Basic Editor (go to Developer tab > Code group > Visual Basic). In the Visual Basic Editor, insert a new module (Insert > Module). Paste the following code into the module:

Sub HideObjects() 
 Dim sh As Shape 
 For Each sh In ActiveSheet.Shapes 
 If sh.Name <> "Picture 1" Then 
 sh.Visible = msoFalse 
 End If 
 Next sh 
End Sub

This code will loop through all shapes on your active sheet and hide them except for Picture 1 (which you can change to whatever object you don't want hidden). To run this code, go back to your worksheet and press Alt+F8, then select HideObjects and click Run.

Move beyond 

Excel

Get started with Causal today.
Build models effortlessly, connect them directly to your data, and share them with interactive dashboards and beautiful visuals.