How to Collapse Columns in Excel (6 Easy Ways)

The collapse columns feature in Excel hides the marked columns from being displayed. We will use the sample dataset below to collapse columns D, E, and F.

How to Collapse Columns in Excel


Method 1 – Using Group Feature to Collapse Columns in Excel

Steps

  • Select the columns you want to collapse.
  • Go to the Data tab.
  • Select the Group drop-down on the Outline group.
  • Select Group from the drop-down list.

How to Collapse Columns in Excel

  • The above steps will make the selected columns grouped as indicated on the upper side as shown in the image below.

How to Collapse Columns in Excel

  • Click on the negative (-) sign.

How to Collapse Columns in Excel

  • Columns D:F will be collapsed.

How to Collapse Columns in Excel

  • Click on the plus (+) sign at the top of Column G.

How to Collapse Columns in Excel

  • You can expand or collapse columns using the plus (+) or negative () sign.
  • Click on button 1 on the top left side as shown in the image below.

How to Collapse Columns in Excel

  • The three columns in our dataset have collapsed.
  • You will notice that Column C and Column G are located side by side.

How to Collapse Columns in Excel


Method 2 – Applying Context Menu to Collapse Columns in Excel

Steps

  • Select columns in the D:F
  • Right-click anywhere on the selected range.
  • Select the Hide option from the context menu.

How to Collapse Columns in Excel

  • It will collapse columns D, E, and F.

How to Collapse Columns in Excel


Method 3 – Collapse Columns with Excel Ribbon

Steps

  • Select columns in the D:F range.
  • Go to the Home tab.
  • Select the Format drop-down on the Cells group.
  • Click on the Hide & Unhide batch under the Visibility section.
  • Select Hide Columns from the available options.

How to Collapse Columns in Excel

  • Columns D:F will be hidden.

How to Collapse Columns in Excel


Method 4 – Setting Column Width to Collapse Columns in Excel

Steps

  • Select the columns D:F that need to be collapsed.
  • Move to the Home tab.
  • Select the Format drop-down on the Cells group.
  • Click Column Width from the options.

How to Collapse Columns in Excel

  • Enter 0 in the Column Width box.
  • Click OK.

How to Collapse Columns in Excel

  • Columns D:F will be collapsed.

How to Collapse Columns in Excel

Read More: How to Hide Columns in Excel with Minus or Plus Sign


Method 5 – Applying Keyboard Shortcut to Collapse Columns

Steps

  • Click on any cell of Column D.
  • Press the CTRL+SPACEBAR.
  • This will select the whole column.

How to Collapse Columns in Excel

  • Press the SHIFT key and tap the RIGHT ARROW (→) key twice to select from Column D to Column F.

How to Collapse Columns in Excel

  • Press CTRL+0 on your keyboard to get the desired result.

How to Collapse Columns in Excel


Method 6 – Applying VBA Code to Collapse Columns in Excel

Steps

  • Press ALT+F11.

How to Collapse Columns in Excel

  • Go to the Insert tab in the Microsoft Visual Basic for Applications window.
  • Select Module from the options.

How to Collapse Columns in Excel

  • Enter the following code in the Module.
Sub Collapse_Columns()
    Range("D:F").EntireColumn.Hidden = True
End Sub

How to Collapse Columns in Excel

  • Click on Run or press the F5 key on your keyboard.

Employing VBA Code

  • Return the worksheet.
  • The worksheet will look like the one below.

Employing VBA Code


How to Expand Collapsed Columns in Excel?

Steps

  • Select Column C and Column G.
  • Go to the Home tab.
  • Select the Format drop-down on the Cells group.
  • Click on the Hide & Unhide batch under the Visibility section.
  • Select Unhide Columns from the options.

Using Home Tab Ribbon

  • The previously collapsed columns D:F will be expanded.

Using Home Tab Ribbon


How to Collapse Rows in Excel?

Step 1: Prepare a Suitable and Structured Dataset

We’ll collapse the rows which contains the orders of Fruit in the sample dataset below.

Preparing Dataset


Step 2: Use Group Feature

  • Select the rows containing orders for the Category- Fruit (rows 5:10).
  • Go to the Data tab.
  • Select the Group option on the Outline group.

Using Group Feature


Step 3: Switch Between (+) and (-) Sign

  • The above steps will make the selected rows grouped as indicated on the left side as shown in the image below.

Switching Between Plus and Minus Sign

  • Click on the minus (-) sign shown in the image below.

Switching Between Plus and Minus Sign

  • Rows 5:10 will be collapsed.

Switching Between Plus and Minus Sign

  • You can expand these rows by following the steps shown above.

Download Practice Workbook


Related Articles


<< Go Back to Hide Columns | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shahriar Abrar Rafid
Shahriar Abrar Rafid

Shahriar Abrar Rafid, BSc, Naval Architecture and Marine Engineering, Bangladesh University of Engineering and Technology, Bangladesh, has worked with the ExcelDemy project for more than 1 year. He has written over 100+ articles for ExcelDemy. He is a professional visual content developer adept at crafting scripts, meticulously editing Excel files, and delivering insightful video tutorials for YouTube channels. His work and learning interests vary from Microsoft Office Suites and Excel to Data Analysis, VBA, and Video recording and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo