Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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: Creating a Center Across Selection Button.

Creating a Center Across Selection Button

by Allen Wyatt
(last updated October 1, 2016)


Excel includes a handy tool that you can use to merge cells and center whatever is within those merged cells. (This tool is available on the Home tab of the ribbon, in the Alignment group.) The problem with this tool is that it merges prior to centering, and you might not want any merged cells in your worksheet.

Fortunately, Excel includes the capability of centering information across a range of cells, without merging them. There is no native tool on any ribbon tab that can perform this task. You can, however, display the Alignment tab of the Format Cells dialog box and use the Horizontal drop-down list to choose Center Across Selection. Doing this frequently within a worksheet can be a pain, but you can create your own tool to center information across whatever cells you've selected:

Sub CenterAcrossColumns()
    With Selection
        .HorizontalAlignment = xlCenterAcrossSelection
        .MergeCells = False
    End With
End Sub

Once you have the macro, you can assign it to a shortcut key or the Quick Access Toolbar.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12183) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Creating a Center Across Selection Button.

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


Entering Many Items In a Drop-Down Form Field

One of the controls you can add to a Word form is a drop-down form field. This field is similar to drop-down lists used ...

Discover More

Counting Changed Words

Track Changes is a handy tool for those who need to see how a document changes over time. If you have a long document ...

Discover More

Understanding File System Formats

When you format a disk drive, you have the option to specify what file system should be used on that drive. There are ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Displaying Negative Times

Excel allows you to perform math using times as operands. If you subtract a later time from an earlier time, you should ...

Discover More

Formatting Currency

If you want to format currency values so that Excel uses periods between groups of thousands and commas as a decimal ...

Discover More

Creating 3-D Formatting for a Cell

The formatting capabilities provided by Excel are quite diverse. This tip examines how you can use those capabilities to ...

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 three less than 5?

2017-10-21 08:49:22

Jim Lennington

The main drawback of this work around is that it requires the spreadsheet to be macro enabled. Most spreadsheets are not macro enabled and having to 'save as ' and rename the file is an extra step. What is is going to take to get Microsoft to add this feature to the ribbon?

2016-10-03 23:38:52

David Gray

@Willy Vanhaelen, thank you for calling attention to the mention of the built-in tool.

@John Mann, there are several ways to make this macro universal. By far the easiest, though least versatile, is to store it in PERSONAL.XLSB. The reason that I think of this as the least versatile is that it becomes part of your individual settings. Another, more versatile option, is to incorporate the macro into an add-in, which is nothing more than a macro-enabled workbook with all of its worksheets hidden. The advantage of an add-in is that it can be made available to all users on a machine, and can be distributed to other users.

2016-10-03 11:05:33

Kevin Miller

I like the Merge Across option but is there a way to have it combine all the text from all merged cells. If I select a range and choose the Merge Across it only keeps the value in the upper left cell and discards everything else. Sometimes I want to merge all the cells into a single cell with the combined content of all cells value in one long string. Thanks,

2016-10-03 09:08:15

John Mann

Does this macro have to reside on the individual workbook, or can it be made universal?

2016-10-03 08:44:51

Carol D. Rice

I use this command all the time - thanks for this tip! Now to create a keyboard shortcut for it would be the next step.

2016-10-02 05:52:18

Willy Vanhaelen

@David Gray

The last sentence of the first paragraph says clearly that the button on the home tab merges prior to centering. I mostly don't want the cells to be merged so I use this macro already for years and find it very useful.

2016-10-02 00:38:22

David Gray

Using a macro to do this seems like overkill, since the default Home tab already has a button that does it for you.

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.