Hide Marked Rows and Columns in Excel

In some of my Excel workbooks there are calculation rows or columns that are required for producing the end result, but users don’t need to see them.

I can manually hide these rows and columns, then unhide them if I need to check a calculation, or adjust a formula.

Mark Row and Columns

To make it easy to hide things, I mark the rows and columns with an X. In the screen shot below,

mark the rows and columns with an X
mark the rows and columns with an X

Select the Marked Columns

First, follow these steps to select the marked columns.

  • Click the row button for row 1, to select the entire row.
  • On the Ribbon, click the Home button
  • In the Editing group, click Find & Select, then click Go To Special

GoToSpecial

  • In the Go To Special dialog box, click Constants
  • Uncheck all the boxes except Text, then click OK

Now, only the cells that contain constant values (the “X” cells) are selected.

GoToSpecialConst

Hide the Marked Columns

Next, with the marked columns selected, follow these cells to hide the columns:

  • Click the Format command on the Ribbon’s Home tab
  • Click Hide & Unhide, then click Hide Columns.

HideColumns

Hide the Marked Rows

Use similar steps to hide the marked rows. Select column A and go to the Constants that are text, then use the Hide Rows command.

Automate the Steps

If you frequently hide and unhide the columns and rows, record a macro as your perform the steps.

Then, run that macro to automatically hide all the marked rows and columns.

12 thoughts on “Hide Marked Rows and Columns in Excel”

  1. My approach is to set outlines on the sheet. Then I have macro buttons on a command bar the will set the outline level for the whole sheet to 1,2,3, etc. using

    ActiveSheet.Outline.ShowLevels rowlevels:=Level, columnlevels:=Level

  2. Actually the outlines are really useful. I typically have up to 5 levels
    Level 1 to 3 will be “User” layers – allowing reveal of areas on the sheet based on user actions
    Levels 4,5 are “Design” layers holding helper columns and the like.

    The macros allow me to open up the whole sheet.

    To open up a single set of rows or columns you just need to identify a single cell within the outlined range. Then,
    range.EntireRow.ShowDetail = True
    will open the whole outlined area.

    You need to be carefull to have spacer rows between outline areas or they won’t always work.

  3. Exactly – I have a button to toggle outline bars on/off for design/presentation.

    I could forward some demo code if you wish.

  4. If you hide or unhide columns / Filter out rows frequently, you are better off defining custom views

    Hide the columns you want, Go To Views – Custom Views and Say Add – give a name – Say customer view
    Uhide all the columns -repeat the process – but call it as complete view.

    Create a Drop down validation – having the name of the views

    In a sheet change event – write a code which will display the view when the user selects from the drop down…

  5. I want to create a macro which will hide columns A, F, G, O,P,Q and rows 11 to 23.

    I need to create a macro and then another one to unhide these columns and rows.

    Please help.

  6. Judith, record a macro while you hide those columns and rows.
    When recording, select Personal Macro Workbook as the place to store them.
    Then record another macro while you unhide them.

    To run the macros later, choose Tools | Macro | Macros
    Select a macro, and click Run.

Leave a Reply to Debra Dalgleish Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.