Merge Cells Shortcut

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:

  1. Using the Merge Cells Shortcut Key in Excel
  2. Merge and Center Shortcut Key
  3. Merge Cells Shortcut Examples
  4. 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:

  1. Select cells that you want to merge
  2. 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.

merge-cells-shortcut

#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.

merge-and-center-command

#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

Using-the-Merge-Across-Shortcut

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.

apply-multiple-selections-using-the-Control-key

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:

multiple-excel-merge-cells-shortcut

#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:

keep-default-alignment

#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.

unmerge-cells

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.

mergeing-cells-only-keeps-the-upper-left-value

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.

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).

record-macro-window-add-shortcut

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.

stop-macro-recording

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.

personal-xlsb-select-module-1

We need only three commands:

  1. Align the text horizontally in the center: Selection.HorizontalAlignment = xlCenter
  2. Center the text vertically: Selection.VerticalAlignment = xlCenter
  3. 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.