Download Practice Workbook
Download the practice workbook.
The title of the dataset below doesn’t fit in B2.
If you expand the column, the whole column will be expanded:
- Select columns B, C, and D in row 2.
- Choose Merge & Center in Alignment (Home tab).
This is the output.
Method 1 – Using an Excel Shortcut to Merge & Center
- To merge multiple cells and center align data, use this shortcut:
Consider the following dataset:
It is divided based on products sold.
To merge cells in Column B and have a single cell for TV and Computer.
Steps
- Select B5:B7.
- Press Alt+H+M+C one by one.
- Select B8:B10.
- Press Alt+H+M+C.
This is the output.
Cells are merged and center aligned.
Note:
This Excel shortcut doesn’t automatically change vertical alignment.
Read More: Shortcut for Merge and Center in Excel (3 Examples)
Method 2 – Using an Excel Shortcut to Merge Cells across Rows
- Use:
This shortcut merges cells across columns. It automatically left-aligns cells.
Consider the following dataset:
The title is in B2. To merge C2 and D2:
Steps
- Select B2:D2.
- Press Alt+H+M+A one by one.
Cells are merged and left-aligned. (This shortcut works for columns only).
Note:
If you choose cells in multiple rows, this shortcut will merge the cells in individual rows.
Read More: How to Combine Two Cells in Excel (6 Quick Methods)
Method 3 – Using an Excel Shortcut to Merge Cells into One Cell
- Use:
You can use this shortcut to merge any number of rows and columns.
Consider the following dataset:
To merge multiple columns and rows and display data in a single cell:
Steps
- Select B5:D7.
- Press Alt+H+M+M one by one.
- Select B8:D10.
- Press Alt+H+M+M.
Three rows and three columns are merged into a single cell.
Read More: How to Combine Cells into One with Line Break in Excel (5 Methods)
Using an Excel Shortcut to Undo Merged Cells
You can unmerge cells merged using the previous methods pressing Alt+Z, but if you have a new workbook from another source, it won’t work.
- To unmerge those cells, use:
Consider the previous dataset with merged cells:
To unmerge the cells with TV and Computer:
Steps
- Select the cell containing TV.
- Press Alt+H+M+U one by one.
- Select the cell containing Computer.
- Press Alt+H+M+U.
Cells are unmerged.
Create a Custom Shortcut with VBA Macros to Merge and Center Cells
This is the dataset:
Steps
- Press Alt+F11 to open Visual Basic Application.
- Select Insert > Module.
- Enter the following code:
Sub Merge_Cells()
With Selection
.HorizontalAlignment = xlCenter
.Merge
End With
End Sub
- Save the file.
- Press Alt+F8 to open the Macro dialog box.
- Select Options.
- Enter Ctrl and a key. Here, Ctrl+j.
- Click OK.
- Select B5:B7.
- Press Ctrl+j.
- Select B8:B10.
- Press Ctrl+j.
Cells are merged and center aligned.
Read More: How to Combine Cells with Same Value in Excel (3 Easy Ways)
Things to Remember
- If you have multiple data in multiple cells, Excel will only show the upper-left value after merging. So, not to lose data, read this article: How to Merge Cells in Excel with Data (3 Ways)
- You can’t perform sorting or filtering on merged cells.
- You can’t copy and paste data into merged cells.
Related Articles
- How to Combine Names in Excel with Space (6 Approaches)
- How to Combine Two Cells in Excel with a Dash (5 Methods)
- How to Combine Cells in Excel (6 Methods + Shortcut)