For various reasons, we need to merge consecutive cells and center align the contents in those cells. Microsoft Excel allows us to merge cells and center align the texts, numbers whatever contents are present in the cells in numerous ways. In this article, you will learn 3 shortcuts to merge and center in Excel with hands-on examples.
Why Merge & Center?
Merging cells means concatenating a number of cells vertically or horizontally which allows us more space to insert contents. Primarily, merge & center is used to create a title bar for the data tables.
Merge & center makes the title bar visually more appealing and also it makes more sense while creating a data table in a Microsoft Excel spreadsheet.
1. Shortcut for Merge & Center in Excel
Look at the screenshot below. We have a data table of columns named Book List. Here the title of the table is Book List which is located only in a single cell.
But we can make the best fit of the title by putting it in the middle of the two columns. This can be easily done using the Merge & Center.
To make the title of the table center aligned,
❶ First select the two cells two merge.
❷ Then press the ALT key.
At this point, you will see the hints of keyboard shortcuts that have appeared like the image below:
The Merge & Center command is located under the Home menu. So,
❸ Press the key H to select the Home menu.
❹ Then press M to go to the Merge & Center group.
After pressing the M key, you will see four more options regarding Merge & center.
❺ Press C to apply the Merge & Center command to the selected cells.
So the shortcut keys for the Merge & Center are ALT > H > M > C. After selecting the cells you have to press those keys one after another. When you hit the final key which is C, you will see the title text has become center-aligned like this:
2. Shortcut for Merge Across in Excel
The Merge Across command can merge all the cells within a single row. But the problem with the Merge Across command is that while merging cells it only allows us to keep the content of the first cells among the selected cells.
So, to apply the Merge Across command using the keyboard shortcut, follow the steps below:
❶ Select the cells in a single row that you want to merge together.
❷ Then press ALT > H > M > A keys one after another.
After that, a warning box like the image below will appear. It says that merging cells only keeps the upper-left cell value and discards the other values. If you agree to the notice,
❸ Hit the OK command.
After that, you will see the selected cells have been all merged together like this:
3. Shortcut for Merge Cells in Excel
If you want to merge cells vertically i.e. within a single column then you can apply the Merge Cells command.
This command only merges cells vertically but not horizontally. Anyways, to apply the Merge Cells command using a keyboard shortcut,
❶ First of all, select the consecutive cells that you want to merge together.
❷ Then press ALT > H > M > M keys one after another.
After that, you will see a warning box that says, “Merging cells only keeps the upper-left cell value and discards the other values.” If that’s alright with you then,
❸ Click on the OK command to proceed further.
After that, you will see the cells have been merged vertically like in the image below:
How to Unmerge Cells
To unmerge cells where you have already applied the Merge & Center command, follow the steps below:
❶ Firstly, select the cell where you have already applied the Merge & Center command.
❷ Then press ALT > H > M > U buttons one after another.
All the Shortcuts Regarding Merge & Center
For your convenience, here are all the shortcut keys relating to merge & center that are discussed in this article:
- Merge & Center: ALT > H > M > C.
- Merge Across: ALT > H > M > A.
- Merge Cells: ALT > H > M > M.
- Unmerge Cells: ALT > H > M > U.
Add Merge & Center to the Quick Access Toolbar
For rapid and smooth workflow, you can add the Merge & Center command to the quick access toolbar. To do that follow the steps below:
❶ Go to the Home menu from the main ribbon.
❷ Under the Alignment group, you will see Merge & Center. Right-click on it.
❸ From the pop-up list, select Add to Quick Access Toolbar.
After that, you will see the Merge & Center icon has been added to the quick access toolbar. From now on you can apply the Merge & Center command from here.
Make a Custom Shortcut Key for Merge & Center Using VBA
You can make your own custom shortcut key to apply the Merge & Center command in Excel.
To do that, follow the steps below:
❶ First right-click on the worksheet name and select View Code. Or you can press the ALT + F11 key to open up the VBA editor.
❷ After that go to Module from the Insert ribbon.
❸ Then copy the following VBA code to the Excel VBA editor.
Sub MergeAndCenter() With Selection .HorizontalAlignment = xlCenter .Merge End With End Sub
❹ Save the code and return back to the worksheet.
❺ Press ALT + F8 to open up the Macro dialog box.
❻ Select the MergeAndCenter function and then go to Options.
After that, a new dialog box called Macro Options will open up.
❼ Set your preferred shortcut key. For instance, we have inserted CTRL + K.
❽ After that hit the OK command.
So your new shortcut key for the Merge & Center command is CTRL + K. Wherever you want to apply the Merge & Center command, just select the cells and then press CTRL + K keys together.
Things to Remember
📌 Always make the cell selection first before applying the Merge & Center command.
Download Practice Workbook
You can download the Excel file from the link below and practice along with it.
To sum up, we have discussed 3 shortcuts for merge and center in Excel. You are recommended to download the practice workbook attached along with this article and practice all the methods with that. And don’t hesitate to ask any questions in the comment section below. We will try to respond to all the relevant queries asap. And please visit our website Exceldemy to explore more.