by Svetlana Cheusheva, updated on
In this tutorial, you'll learn 4 easy and quick ways to hide columns in Excel.
Somewhere I read that hiding something is never good as it only makes people more curious about it. Personally, I don't think that hiding things is always bad as it is in our nature. Moreover, this concept is universal. You probably noticed that dogs often hide their food or toys guided by an instinct to guard their possessions. People also have many secrets to hide, such as medical records, credit card numbers, or bad habits.
Read on to see how to hide unwanted columns in an instant with a keyboard shortcut or VBA code, and how to leverage the Group feature to cover-up and expand columns.
The possibility to hide columns in Excel is really helpful. There may be lots of reasons for keeping certain details from showing. For example:
The shortcut for hiding columns in Excel is Ctrl + 0.
For the sake of clarity, the last key is zero, not the uppercase letter "O".
Tip. The shortcut for unhiding columns in Excel is Ctrl + Shift + 0. To make the hidden columns visible, highlight at least one cell in the columns on both sides of the hidden one(s), and use the shortcut. The bad news is that this key combination does not work in some versions of Windows for unknown reasons. In this case, use another method of unhiding columns in Excel.
Don't want to bother remembering the hotkeys? Here's another amazingly simple way to hide columns in Excel:
Voila! Now you can easily review your data skipping the extra details.
As its name suggests, this option is tucked away deep in the menus, so you need to know where to look for it :)
To hide unwanted columns by clicking a ribbon button, the steps are:
Done! The information that you don't want to view or print is hidden.
Like many other things, hiding columns in Excel can be automated with VBA. In fact, it's a very simple operation, and we'll try to explain the whole concept here.
To do "concealing" programmatically, you can use either the Range or Columns property.
To hide a single column, say column C, the codes are:
Code 1
To specify the column, we use the Range object. To indicate that the entire column should be hidden, the corresponding properties (EntireColumn and Hidden) are added:
Code 2
To hide a column using the Columns property, the code is even simpler:
To hide multiple columns, the codes are essentially the same, except that you specify the first and last columns (A:C in our case).
Code 3
Code 4
To insert the codes in your workbook, please follow these step-by-step instructions: How to insert and run VBA code in Excel. A sample workbook is available for download at the end of this page.
Notes:
To make only the working area of your sheet visible, you can hide all unused (blank) columns to the right of your data. Here's how:
As the result, the workspace is cleaned up and only the relevant information is displayed to the users:
If your worksheet contains a lot of columns, it may be handy organize them in groups to easily show and hide different sections of the sheet. To group columns in Excel, this is what you need to do:
As an example, we are going to group columns B through I that contain item details and monthly sales figures:
As we've selected the whole columns, clicking the Group button immediately creates the grouping, and the outline symbol appears at the top of the worksheet.
To hide the columns, click on the minus (-) sign above the group.
Alternatively, you can collapse and expand groups by using the outline numbers in the upper-left corner. In the screenshot above, clicking on 1 will conceal all the columns between A and G, so that only these two columns are visible.
To unhide the columns, click on either the minus (-) sign or the outline number 2:
To remove grouping, do one of the following:
Tips and notes:
That's how to hide and show columns in Excel. I thank you for reading and hope to see you on our blog next week!
Hide columns in Excel with VBA – code examples (.xlsm file)
Table of contents