The Excel Merge Cells Shortcut helps you combine and center the content of the selected cells and creates a new, 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 Merge Cells 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 if you want 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 command.
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 above-mention shortcut: 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, apply multiple selections using the Control key. 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 at the same time.
Now use the Alt, H, M, A key sequences.
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
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 key
Tip: Excel keeps the cell background formatting after revoking the merge command. So, in the example, the example green background remains.
Good to know: 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 that 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:
1. Enable the Developer Tab if it disappears. Next, locate the Code Group and press the Record macro button.
2. Add a name for your recorded macro. In the example, the name is ‘QuickMerge.’
3. Add a custom shortcut key carefully. 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: If you want to save this shortcut key, store the macro in the Personal Macro Workbook!
Add a short description if you want.
4. Click OK to start recording a new macro.
Select cells that you want to combine into one using the merge cells shortcut.
Finally, press Alt, H, M, C to merge cells.
5. Stop the Macro Recorder.
The fastest way to reach the recorded macro is using the Alt + F11 shortcut. (Excel opens the VBA editor window)
Tip: If you click on Macros in the Developer Tab, the result is the same.
6. 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 merge cells 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. Recommend checking it! Thanks for being us! Stay tuned.