Do you want to protect sensitive data? Or do you want to create a cleaner, more focused presentation of your data? No matter the reason, it’s essential to know how to hide columns and rows in Excel.
To hide a column in Excel:
- Click on the letter above the column.
- Right-click the selected column.
- Choose “Hide” from the context menu.
In this article, we’ll discuss several other ways to hide columns with step-by-step instructions.
Let’s get started.
5 Methods to Hide Columns in Excel
There are several ways to hide columns in Excel. We will discuss the following ways of hiding columns in Excel:
- Hide columns using the Context Menu
- Hide columns using the Home tab
- Hide columns using the Excel Shortcut
- Grouping and hiding columns
- Hide columns using a VBA code
1) How to Hide Columns Using The Context Menu
One of the easiest ways to hide Excel columns is to use the Context Menu.
To use this method, follow these simple steps:
Step 1
Select the columns that you want to hide.
To select the entire column, click on the letter(s) above the columns (Column letters) you wish to hide.
To select multiple non-adjacent columns, hold the Ctrl key (Windows) or Cmd key (macOS) while clicking on each column letter. For adjacent columns, click on the first column letter, press and hold the Shift key, and click on the last column in the sequence.
Step 2
Right-click on the selected columns to open the Context Menu.
Without right-clicking, you can press the “Menu” key on your keyboard to open the above menu. The “Menu” key is between the Right “Alt” key and the Right “Ctrl” key.
Step 3
Select Hide from the Menu.
Then, Excel hides the selected column/columns.
To unhide all the hidden columns, select the entire sheet and select unhide from the right-click menu.
2) How to Hide Columns Using The Home Tab
Another easy way to hide columns in Microsoft Excel is to use the Home tab of the Excel ribbon.
To hide the columns using the ribbon follow the steps given below:
Step 1
Select at least one cell from each of the columns that you want to hide.
For example, if you want to hide column C, you can select any cell of Column C.
Step 2
Go to the Home tab.
Find the Cells group, and click the Format button.
From the drop-down menu that appears, choose Hide & Unhide, then select Hide Columns.
Then, Excel hides the selected cell’s column/columns.
Remember that hidden columns will appear as a double line between the columns that remain visible. To unhide columns, you can double-click on the double line.
3) How to Hide Columns Using Keyboard Shortcuts
One efficient and quick method for hiding columns in Excel is to use keyboard shortcuts. Many users find keyboard shortcuts to be a more convenient method than navigating through menus and clicking with a mouse.
Following the steps given below to hide columns using keyboard shortcuts:
Step 1
First, you need to select any cell of the column you would like to hide.
For example, to hide column C, I have selected cell C2 in the below image.
Step 2
Press “Ctrl + 0″. The last character of this shortcut is zero and not the uppercase letter O.
This keyboard shortcut will hide the column that you want to hide instantly.
If you want to hide multiple columns, you have to select one or more cells from each column.
4) How to Group and Hide Columns in Excel
Sometimes you may want to hide and unhide columns temporarily. In such situations, grouping and hiding columns is the best way for you.
To group and hide columns, follow these steps:
Step 1
Select the adjacent columns or the column that you want to hide.
Step 2
Go to the Data tab in the Excel toolbar.
Step 3
Click on the Outline icon.
Step 4
Click on the Group icon.
A new outline with plus (+) and minus (-) signs will appear above the selected columns.
It indicates those columns are grouped together.
To hide the columns within the group, simply click on the minus (-) sign above the group.
To unhide them, click on the plus (+) sign.
Additionally, you can collapse and expand groups using the outline numbers located in the upper-left corner of your spreadsheet.
If you prefer keyboard shortcuts, you can use the following commands to group and ungroup columns:
- Group selected columns: Shift + Alt + ?
- Ungroup selected columns: Shift + Alt + ?
Make sure to select entire columns by pressing Ctrl + Space before using these shortcuts.
5) How to Hide Columns Using VBA
Visual Basic for Applications (VBA) is a powerful tool that can significantly enhance your experience with Excel, including hiding columns efficiently.
Follow the steps listed below to hide columns in Excel using VBA:
Step 1
Press “Alt + F11” to open the VBA Editor.
Step 2
In the VBA editor, click on ‘Insert’ and select ‘Module’ to create a new module where you can write your VBA code.
Step 3
One way to hide a single column in Excel using VBA is by using the EntireColumn.Hidden property.
For example, to hide Column C, use the following code:
Sub Hide_Column()
Range("C:C").EntireColumn.Hidden = True
End Sub
The demonstrates is shown in the image below:
Step 4
Click the Run button.
To hide multiple columns at once, you can modify the range in the code. For instance, you can hide columns B through D like this:
Sub Hide_Columns()
Columns("B:D").EntireColumn.Hidden = True
End Sub
To learn how to automatically remove all empty columns in Power Query, check the following video out:
Final Thoughts
Hiding columns in Excel means making some columns disappear temporarily. This helps you see only the important stuff and avoid extra details. It’s handy when you have lots of information.
To hide columns, you can select any of the above methods that we’ve discussed in this article.
You can use these methods to hide columns until you want them back. This is a useful trick for organizing your large volume of data efficiently.
Frequently Asked Questions
In this section, you’ll find some frequently asked questions you may have when hiding columns in Excel.
How can I conceal columns using a shortcut?
To hide columns using a shortcut, first, select the column(s) you want to hide by clicking the column header(s).
If you need to select multiple non-adjacent columns, press and hold the Ctrl key while clicking on each column header.
Then, use the keyboard shortcut Ctrl + 0 (for Windows) or Cmd + 0 (for macOS) to hide the selected columns.
What is the method for hiding columns with a formula?
Hiding columns directly with a formula is not possible in Excel.
However, you can conditionally format cells or use other methods like filtering to make specific data less prominent in your spreadsheet.
Is it possible to protect hidden columns with a password?
Yes, you can protect hidden columns with a password in Excel.
First, hide the columns, and then go to the Review tab, click Protect Sheet, and check the option Protect worksheet and contents of locked cells.
Enter a password and confirm it to secure your hidden columns.
How do I utilize VBA to hide columns?
To hide columns using VBA, press Alt + F11 to open the Visual Basic for Applications Editor.
Insert a new module by clicking Insert > Module and then paste the following code:
Sub Hide_Column()
Columns("A:A").Hidden = True
End Sub
Replace “A” with the column(s) you want to hide, save your project, and run the macro by pressing F5 or clicking the green Run button.
What are alternative ways to hide columns without right-clicking?
You can hide columns in Excel using the Home tab by selecting the column(s) and then clicking on Format > Hide & Unhide > Hide Columns. Additionally, you can use the Data tab to hide columns by applying filters or groups.