Method 1 – Using Ribbon to Center Text in a Cell in Excel
1.1 Use Center Align Option
Steps:
- Select the whole data table and go to the Home tab.
- Click on the Center option from Alignment in the upper ribbon portion.
- The text will be aligned in the center.
1.2 Utilize Format Option
Steps:
- Select the whole data table and go to the Home tab.
- Choose the Format Cells option from the Format tab.
- The Format Cells window will open.
- Go to the Alignment option.
- Select the Center option in both Horizontal and Vertical under Text alignment.
- Press OK to get the desired result.
- All text will be in the center.
Method 2 – Center Text in a Cell in Excel Using Context Menu
Steps:
- Select the whole data table and Right-Click on the table.
- Choose the Format Cells tab.
- The Format Cells window will open. Select Alignment and go to the Text alignment option to choose the Center option in both the Horizontal and Vertical alignment.
- Press OK.
Method 3 – Applying Excel VBA Code to Center Text in a Cell
Steps:
- Select the data table and press Alt+F11 to open the VBA Code window.
- Go to the Insert tab and select the Module option to open a new module window.
- In the new module window, insert the following code:
Sub CenterTextHorizontallyAndVertically()
Selection.HorizontalAlignment = xlCenter
Selection.VerticalAlignment = xlCenter
End Sub
- Click on the Run tab or press F5 to run the code.
- It will center align all the text.
How to Center Text Across Multiple Cells in Excel
Steps:
- In cell B2, we have Centering Text Across Multiple Cells.
- We want to make the writing headings of both Column B and Column C.
- Select both cells B2 and C2.
- Go to the Home tab and click on the Merge and Center option.
- The result will look like the image below.
Download Practice Workbook
Related Articles
- How to Justify Text in Excel
- How to Align Colon in Excel
- How to Align Columns in Excel
- How to Align Currency Symbol in Excel
- How to Align Numbers in Excel
<< Go Back to Alignment in Excel | Excel Cell Format | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!