Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Shortcut to Merge Cells.

Shortcut to Merge Cells

by Allen Wyatt
(last updated October 22, 2015)


Excel allows you to merge cells together in two ways: using the Merge and Center tool on the ribbon or toolbar, or by using the controls in the Alignment tab of the Format Cells dialog box. If you merge cells quite a bit, you might long for a shortcut that will merge whatever cells you've selected.

Unfortunately, Excel doesn't include such a shortcut. You can, however, create one using a macro. The following is a simple macro to merge whatever cells you've selected:

Sub MergeCells1()
End Sub

After you create the macro, you can assign it to a keyboard shortcut and you are set to go. If you instead want a macro that is a shortcut for the Merge and Center tool, then you can use the following:

Sub MergeCells2()
    With Selection
        .HorizontalAlignment = xlCenter
    End With
End Sub

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12458) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: Shortcut to Merge Cells.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Hyperlinks to PDF Files Won't Open

If you have a document that contains hyperlinks to a PDF file, it is possible that the links may not open the PDF file ...

Discover More

Editing an AutoText Entry

Once you've created an AutoText entry, you may believe that it is "set in stone" and cannot be changed. Not so! You can ...

Discover More

Printing Web Discussions

If you are using the Web discussions feature built into some versions of Excel, you may want to print out a discussion at ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Automatically Copying Formatting

It's easy to automatically set the contents of one cell to be equal to another cell. But what if you want to copy the ...

Discover More

Rounded Corners on Cells

As you are formatting a worksheet, Excel allows you to easily add borders to cells. Adding rounded corners to cells is a ...

Discover More

Changing Font Sizes

Want to change the size of the font within a worksheet? Excel allows you to choose from a list of sizes, as well as define ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 3?

2015-10-22 07:16:48

Les Hawkins

what are the steps to create this macro and assign it a keyboard shortcut?

2015-10-22 07:15:27

Mercy Huber

David, if you click on the arrow next to the Merge & Center button you can choose Merge Across and it should do what you are looking for.

2015-08-11 18:23:42



Loving this site!
I've searched for a tip on how to merge from one column to the cell next to it. I'm trying to avoid having to do the following:
1. Making a column super wide so information can all be seen
2. Going row by row to merge 790 book titles; and book descriptions.

I hope this makes sense. I'd love to be able to highlight one column and merge the cells (B1, B2, B3 - B790) to (C1, C2, C3, - C790) and NOT make one huge cell.

Also, there are typically (multiple) headers above the titles so the ask above won't work. Same scenario except in stead of columns, I'd like to highlight (B10, B11 - B790) and then merge that with the corresponding C cells (C10, C11 - C790) but the merge be row by row... not one big cell from B10 - C790.

2015-02-04 04:23:21


You, my friend, are my new hero!

2013-02-06 08:48:13

Brandon Moxley

I have modified the macro slightly to work better for me, and others may find it helpful as well.

The modification allows the cells to be unmerged, as well as merged, whereas the above macros will only merge.

Sub MergeCells()
' If the selection is already merged, unmerge it
If Selection.MergeCells Then
Selection.MergeCells = False
' Else, merge the selection(s), and center vertically and horizontally
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
End If
End Sub

2013-02-05 07:30:01

John Summers

Thanks, Glenn. It doesn't help with my particular requirement but I've already found a use for it elsewhere!

2013-02-04 09:00:30

Glenn Case

Actually, I often to the exact opposite. Merged cells are a real pain, as they prevent you from doing many normal operations on any range they intersect (or are even parallel with), such as inserting extra columns. To address this, I have a macro which selects the entire worksheet, and then runs Selection.Unmerge top remove this impediment.

A much better solution to Merge is to use "center across selection", available under "Format Cells/Alignment."

2013-02-03 16:12:39

John Summers

I use the shorter macro via an icon on the QAT. One of the most common uses to which it is put is adjusting Report and Page Headers exported (in an annoying manner)from Crystal Reports. The investment of time involved in creating has been repaid many times over.

2013-02-02 09:02:56

Brian Hershman

Two facts to note:
(1) The merge will only work if the selected cells are consecutive AND in a straight line(i.e. row or column);
(2) it merges the [appearance of the] cells, NOT their values: the only value shown is that of the top/left-most cell

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.