The Excel merge cells shortcut helps you combine and center the content of the selected cells and creates a larger cell using a single cell.
In this article, we’ll help you to discover the merge cells shortcut to save you time. Let’s get started!
Table of contents:
- Using the Merge Cells Shortcut Key in Excel
- Merge and Center Shortcut Key
- Merge Cells Shortcut Examples
- Create a custom shortcut using VBA
Using the Merge Cells Shortcut Key in Excel
What is the goal of using merge cells in Excel? Merging cells is a smart way to create a table header for dashboards or reports. However, the most used method can take longer because we can not apply shortcuts for the merge and center commands.
There are four different keyboard shortcuts to merge and unmerge cells in Excel. Let us see the details!
Merge and Center Shortcut Key
Steps to merge and center cells using a shortcut:
- Select cells that you want to merge
- Apply the Alt, H, M, C shortcut key sequence
Take a closer look at how the shortcut works: First, the Alt key activates the ribbon shortcuts. After that, If you press the H key, Excel will highlight the Home Tab. Next, press M to activate the Merge and Center drop-down list. Finally, press C to select and apply the Merge and Center option.
Merge Cells Shortcut Examples
You have four options under the ‘Merge and Center’ drop-down list. This section will show you how these functions work using shortcut examples.
#1. How to merge and center cells?
In the example, you want to merge and center the cells from C4 to E4.
Use the shortcut mentioned above: Alt, H, M, C
This command will combine and center the cell content in Excel.
#2. Using the Merge Across Shortcut
This feature works only on the selected rows. The Merge Across function joins cells across columns but not rows. After that, you will get a right-aligned text with combined cells.
Shortcut to Merge cells Across is Alt, H, M, A
Do you want to merge cells across using multiple ranges? No problem! For example, use the Control key to apply multiple selections. Select the range of cells: first, from cell C4 to E4, then F4 to H4, and finally, I4 to K4.
You can select groups of rows, but Excel will process each group separately. It is a time-saving feature if you want to join multiple groups simultaneously.
Now use the Alt, H, M, A key sequences.
Result:
#3. Merge cells Shortcut (keep default alignment)
The merge cells function only combines the selected cells into one without changing the alignment.
Select the cells that you want to merge:
Shortcut to merge cells (combine only option): Alt, H, M, M
Result:
#4. Shortcut to unmerge cells
Sometimes, you must modify your table and revoke the merge cells shortcut.
To unmerge a cell, use the Alt, H, M, U shortcut keys.
Note: Excel keeps the cell background formatting after revoking the merge command. So, in the example, the example green background remains.
Troubleshooting
The merge command only keeps the upper-left value and discards other text in the selected range. To avoid errors, Excel warns you before this happens. You’ll face a popup window when you approve the command.
Everybody knows the merge and center operation is the most used merge-related function. The following guide will show you how to record a small macro and create an even shorter shortcut.
Create a custom Merge Cells Shortcut using VBA
Steps to create a Merge Cells Shortcut:
If the Developer Tab disappears, enable it. Next, locate the Code Group and press the Record macro button.
Add a name for your recorded macro. In the example, the name is ‘QuickMerge.’
Finally, carefully add a custom shortcut key. The new shortcut will override the old keys if the entered shortcut is reserved. (Please do NOT try to add the Ctrl + C).
There are never-used keys in Excel. Pick a good one. For example, you’ll add the following shortcut key: Ctrl + Shift + Q
Tip: To save this shortcut key, store the macro in the Personal Macro Workbook! You can also add a short description.
The next step is to click OK to start recording a new macro.
Select cells you want to combine into one using the merge cells shortcut and press Alt, H, M, C to merge cells.
Stop the Macro Recorder.
The fastest way to reach the recorded macro is using the Alt + F11 shortcut. The result is the same if you click on Macros in the Developer Tab.
Select the Modules section and click Module1. Then, using the right side pane, you can edit and clean up the macro based on the recorded steps.
We need only three commands:
- Align the text horizontally in the center: Selection.HorizontalAlignment = xlCenter
- Center the text vertically: Selection.VerticalAlignment = xlCenter
- Merge the text into one cell: Selection.Merge
Here is the code:
Sub QuickMerge()
' Keyboard Shortcut: Ctrl+Shift+Q
Selection.HorizontalAlignment = xlCenter
Selection.Merge
End Sub
There is only one thing left: save the ‘Personal.xlsb’ file! It’s time to try how the shortcut works. Open a new Workbook! Select a few cells and press Ctrl + Shift + Q. As a result of the recorded macro, Excel will combine the selected cells using this simple keyboard shortcut.
Final Thoughts and Tips
Using this guide, you have learned how to use the most crucial shortcut keys to merge cells in Excel. This article is a small part of our guide about Excel Shortcuts. I recommend checking it! Thanks for being us! Stay tuned.