How to Center Text in a Cell in Excel (3 Easy Methods)

This tutorial will demonstrate how to center text in a cell in Excel. To make any data table more visually attractive, it is important to align the data text into the center position in a cell. It creates a huge impact on the reader or viewer. So, in this, our main goal is to learn about the whole process with a proper image.

To understand easily, we’ll use a sample dataset as an example in Excel. For instance, we have names of different people in Column B marked as Name and Student ID in Column C. We will use this dataset for all the methods described below.
Methods to Center Text in a Cell


1. Using Ribbon to Center Text in a Cell in Excel

Using Excel Ribbon is the fastest way to center text in a cell in Excel. Excel ribbon can be used in two forms: one is using the Center Content Option and the other is applying the Format Option. Both of these forms will easily center the text in a cell if the below steps are followed properly.


1.1 Use Center Align Option

The Center content option is found in the Home tab in the upper portion of the window. So, it is very convenient to find and use. By using this option we can center the text in a cell in Excel in the following ways:

Steps:

  • First, select the whole data table and go to the Home tab.
  • Next, click on the Center option from Alignment in the upper ribbon portion.

Using Excel Ribbon to Center Text in a Cell

  • After that, you will find the result in the below image.

Using Excel Ribbon to Center Text in a Cell


1.2 Utilize Format Option

In this case, our goal is to use the format option from the ribbon tab. For this, we have to follow the steps described below:

Steps:

  • Firstly, select the whole data table and go to the Home tab.
  • Secondly, choose the Format Cells option from the Format tab.

 

Excel Ribbon to Center Text in a Cell

  • Then, the Format Cells window will open on your display screen.
  • Afterward, go to the Alignment option.
  • This time, select the Center option in both Horizontal and Vertical into the Text alignment.
  • Finally, press OK to get the desired result.

Using Excel Ribbon to Center Text in a Cell

  • If you have followed all the steps perfectly, then you will get results like the below image.

Read More: How to Align Text in Excel


2. Center Text in a Cell in Excel Using Context Menu

If in any case the ribbon tab is not available or you want to center text in a cell with only the mouse and keyboard then you have to use the Context Menu option. The steps will lead you to learn the whole process:

Steps:

  • First, select the whole data table and Right-Click on the table.
  • Then, choose the Format Cells tab.

Center Text in a Cell in Excel Using Context Menu

  • After that, the Format Cells window will open on the screen. In this case, again select the Alignment and go to the Text alignment option to choose the Center option in both the Horizontal and Vertical alignment.

  • After pressing OK, you should have found the result like the below image.

Read More: How to Apply Center Horizontal Alignment in Excel


3. Applying Excel VBA Code to Center Text in a Cell

In all cases, the most effective way to center text in a cell in Excel is by applying the VBA code. If a person wants to know how the text alignment is changing from any position to the center position then the best way is to learn by the VBA code. The description of this process is written below:
Steps:

  • Initially, select the data table like the other two methods and press the Alt+F11 buttons to open the VBA Code window.
  • Then, go to the Insert tab and select the Module option to open a new module window.

pplying VBA Code to Center Text

  • In the new module window, insert the following code:
Sub CenterTextHorizontallyAndVertically()

Selection.HorizontalAlignment = xlCenter

Selection.VerticalAlignment = xlCenter

End Sub

pplying VBA Code to Center Text

  • Next, click on the Run tab or press F5 to run the desired code.

pplying VBA Code to Center Text

  • In the end, you will find results like the below image.


How to Center Text Across Multiple Cells in Excel

When we are dealing with high-volume data, it is very necessary to merge many cells and center the text in the merged cells in Excel. Otherwise, the data will be very difficult to understand. To learn this process we will show the steps below:

Steps:

  • Firstly, in the B2 cell, we have written Centering Text Across Multiple Cells.
  • Now, we want to make the writing headings of both Column B and Column C.

  • So next, select both B2 and C2 cells.
  • Then go to the Home tab and click on the Merge and Center option.

  • Finally, we will get the result like the below image.

Read More: How to Align Decimal Points in Excel


Things to Remember

  • The fastest way is the first method. The other two methods are also helpful but the first method is always recommended.
  • In the case of using VBA code, it is very important to save the code. Otherwise, the code won’t run.
  • In the case of merging the cells, it is necessary to focus on which cells you are merging. If you merge the wrong cells then the data will create huge confusion.

Download Practice Workbook

You can download the practice workbook from here.


Conclusion

Henceforth, follow the above-described methods. Thus, you can learn how to center text in a cell in Excel. Let us know if you have more ways to do the task. Don’t forget to drop comments, suggestions, or queries if you have any in the comment section below.


Related Articles


<< Go Back to Alignment in Excel | Excel Cell FormatLearn Excel

Get FREE Advanced Excel Exercises with Solutions!
Zehad Rian Jim
Zehad Rian Jim

Zehad Rian Jim is a dedicated professional with a BSc. Degree in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology. He's good with Microsoft Office and has written more than 80 helpful articles for ExcelDemy in the last year. Now, he makes fun and easy-to-follow Excel tutorials for YouTube as part of the ExcelDemy Video project. Zehad loves figuring out Excel problems, and his passion for learning new things in Excel shines through in... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo