Excel Shortcut Keys for Merge and Center

Merge & Center combine and center the contents of the selected cells in a new, larger cell. This is a great way to create a label that spans multiple criteria. This is used to combine multiple cells into a single cell and create the main headers for reports in Microsoft Excel.

So when you work dashboards, you get the need for Merge and Center cells. The traditional way is lengthy and there is no simple shortcut to merge and center, like CTRL+C for copying. But there are ways to workaround.

Sequential Merge and Center shortcut in excel (ALT>H>M>C)

To merge and center two or more cells follow these steps:

  • Select the cells
  • Press and release ALT key, following by H, M, and C key on keyboard.

This is not actually a shortcut to merge cells in excel but it is fast. The ALT key activates the ribbon and following keys take you to the Merge and Center option. H takes you to Home tab, M takes you to Merge and Center options and C selects the Merge and Center option.

 

24

As we can see text in B1 cell is now merged and centered in B1 to D1 cells.

Merge And Center Options

There are four options available in Merge and Center:-

  • Merge and Center: This feature Combines & centers the cell text in Excel. Use the above shortcut for merge cells.
  • Merge Across: To Merge Across use shortcut  ALT>H>M>A. This feature works only on the selected rows. Combines the multiple columns of the row. The text in the merged cell will be right-aligned.
  • Merge Cells: This feature just combines the selected cells. To only merge cells in excel use shortcut Use ALT>H>M>M .
  • Unmerge Cells: This features Unmerge the selected cells to their default location. The shortcut to unmerge cells is ALT>H>M>U.

22

We are going to focus on Merge and Centre here.

Best Shortcut For Merge and Center (CTRL+j)

As I said, there is no specific shortcut for merge and center but you can create one using macros. It’s easy.

  • Click on the Record Macro button on the status bar or go to Developer Tab and click on Record Macro. If you don’t see a Developer Tab, first add Developer Tab.

Presentation1

Presentation1

  • Give a name to this macro. For example, mergeCellsShortcut.
  • Define any shortcut you like for Merging Cell in Excel in ‘Shortcut key:’ section. Be careful while defining the shortcut. If you define any shortcut that is already defined then this will override the previous one. There are some keys that are free in excel, Like CTRL+j. I will use this as my shortcut of Merging cells. if you want to involve SHIFT KEY, press SHIFT+J.
  • If you want this macro to run on the current file then choose This Workbook in ‘Store macro in:’ section. If you want your shortcut to merge and center to work on every workbook then choose Personel Macro Workbook.

Capture

  •  Click on OK.
  • Now stop recording from the developer tab or status bar.
  • Click on Macros in Developer Tab or press ALT+F8 the list of available macros will appear.
  • Select mergeCellsShortcut and click on Edit.
  • now copy below line to only merge cells in between sub and end sub(). Selection.Merge ‘to merge selected cells.
            Selection.Merge 'to merge selected cells

Now you have a shortcut to merge cells. If you instead want to merge and center then add this line in macro

Selection.HorizontalAlignment = xlCenter

And if you want to the text to be in the center of the cell vertically too, add this line too.

 Selection.VerticalAlignment = xlCenter

Finally, your code will look like this,

Sub mergeCells()

' mergeCells Macro

 Selection.HorizontalAlignment = xlCenter ' to align text horizontally in cent
 Selection.VerticalAlignment = xlCenter ' to align text vertically in center
 Selection.Merge ' to merge cells
End Sub

Capture2

Now, whenever you’ll press CTRL+j, all selected cells will be merged. And this how you get a shortcut to merge and center cells in excel.

Note: Merge and Centre option takes the text of only one cell which will be upper-left most cell while performing Merge and center.

You have to be careful about your content in the cells which is to be merged.

Example of Merge And Center in Excel

We need to merge cells B1 to D1. When we’ll use ALT>H>M>C excel shortcut to merge cells, excel will show a warning. This warning says that all cells will lose their data except upper-left cell if we merge and center these cells.
26

Click OK and output will be like as shown below.
27

Now the same function will be performed on E1 to G1 cell and H1 to J1 cells.

So we will use the F4 key to perform the last function again.
28

In the above image data of Team A is under Team A label. Similarly, for Team B and Team C, we can say the same.

Frequently Asked Questions

Q1. How to merge columns in Excel?
Ans: Simple, select the columns and press keys ALT>H>M>C sequentially. Done. Next.

Q2. How to unmerge cells in excel?
Again same, select merged cells and press keys ALT>H>M>C sequentially. Done. Next.

Q3. How to merge cells in word?
Well, this is an Excel tutorial but still, select the cell in word and press ALT>J>L>M.

Please find more articles on Labeling and highlighting cells here. Hope you got this by now. Please share your queries in the comment box below. We will solve it for you.

Users are saying about us...

  1. Hi,
    How can I merge the cells of a column with identical values. E.x. An excel had 10 columns and 500 rows. Each row has a column E with name field and excelsheet is sorted on that column. Now I want to merge the column E ‘name’ only for all the rows of same name. Like there are 5 rows for Name ‘John’ then for all those five rows the name cells will be merged into one cell and rest of the cells for those rows will remain unchanged. This should happen for each Name.

    Thanks,
    Sachin

  2. Ravin Paul F. Chavez

    Hi there! Can you please add some pictures? We cannot understand the details. Please also add videos. Thank You!

  3. Yes, Abdul Hannan. That’s the only drawback of macros. You can’t undo any work done with a macro using CTRL+Z command in excel. The unmerge can be done manually.
    You should be really sure before running any complex code that changes the file a lot. You’ll not be able to get back using undo command. the best way is to keep a copy of the previous file.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Visit Us On TwitterVisit Us On FacebookVisit Us On Google PlusVisit Us On Youtube