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.
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.
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.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Excel often changes the formatting of a cell based on how it parses what you are entering into that cell. This is ...Discover More
You can use the Paste Special feature in Excel to multiply the values in a range of cells. If you don't want Excel to ...Discover More
Need the contents of a cell to be shown in a direction different than normal? Excel makes it easy to have your content ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.