Looking for ways to change the alignment to the right in Excel? Then, you’ve come to the right place. In fact, this article demonstrates 5 ways you can change alignment in Excel to the right.
Download Practice Workbook
You can download the practice workbook from the link below.
5 Ways to Change Alignment in Excel to the Right
Aligning text or numbers is a formatting property that determines how a paragraph of text appears. So, without further delay, let’s explore the methods of aligning text one by one.
Throughout this article, we’ll be using the dataset containing Best Selling Books shown in the B4:C14 cells below. Here, the dataset shows the Product ID and the names of the Best Seller books respectively.
We have used Microsoft Excel 365 version here, you can use any other versions according to your convenience.
Method-1: Using Ribbon to Change Alignment in Excel to Right
Let’s start things off with the most popular method i.e. using Excel’s Ribbon tool to right-align the contents of a cell. So, just follow along.
- Initially, select the C5:C14 cells.
- Then, go to the Home tab located at the top left corner.
- Next, in the Alignment section, click the Align Right button.
That’s it, you’ve right-aligned all the texts as shown in the image below.
Read More: How to Align Text in Excel (3 Quick Methods)
Method-2: Change Alignment to Right Using Keyboard Shortcuts
If you’re wondering about keyboard shortcuts to right-align text, then I have some good news for you. Now, allow me to demonstrate the procedure below.
- At the very beginning, select the C5:C14 range of cells.
- Now, on your keyboard press the ALT + H keys.
After completing the above steps, the Key Tips shortcuts appear in the Home tab.
- Following this, press the A + R keys on your keyboard.
This completes the process of aligning the text to the right.
Read More: How to Left Align in Excel (3 Handy Ways)
Method-3: Aligning Text to Right with Format Cells Wizard
For our third method, we’ll use the Format Cells dialog box to right-align text. So, just follow these simple steps.
- Firstly, select the C5:C14 cells, and press CTRL + 1 on your keyboard.
After that, the Format Cells dialog box will open up.
- Then, select the Alignment tab >> in the Horizontal field, click the drop-down >> choose the Right (Indent) option >> press OK.
The results should look like the picture shown below.
Method-4: Utilizing Custom Number Format
Another quick way to right-align text involves the use of a custom Number Format. This method is somewhat similar to the previous method so let’s begin.
- Similar to the previous method, select the C5:C14 cells >> press CTRL + 1 key.
Likewise, the Format Cells dialog box will pop up.
- In turn, go to the Number tab >> select Custom in the Category field >> in the Type field enter the expression * @ >> press OK.
In the above expression, the Asterisk (*) symbol repeats the characters after it until the cell is filled. Next, the Space ( ) character is combined with the Asterisk to change text alignment. Lastly, the At (@) sign holds the string of text.
This gives the following results as shown in the screenshot below.
Method-5: Applying VBA Code to Align Text
Have you ever thought of automating the same boring and repetitive steps in Excel?
Think no more, because VBA has you covered. In fact, you can automate the prior methods entirely with the help of VBA code. It’s simple & easy, just follow along.
Step-01: Open Visual Basic Editor
- Firstly, select the C5:C14 cells >> navigate to the Developer tab >> click the Visual Basic button.
This opens the Visual Basic Editor in a new window.
Step-02: Insert VBA Code
- Secondly, choose the Sheet where you want to insert a Module.
- Next, go to the Insert tab >> select Module.
For your ease of reference, you can copy the code from here and paste it into the window as shown below.
'This is sub routine for right-aligning a range of cells Sub ExcelRightAlign() 'Using the Selection and Horizontal Alignment properties Selection.HorizontalAlignment = xlRight End Sub
Now, I will explain the VBA code used to right-align text. In this case, the code is divided into two steps.
- Firstly, the sub-routine is given a name.
- Secondly, the Selection property selects the cells, in this case, C5:C14 cells.
Step-03: Running VBA Code
- Thirdly, close the Visual Basic editor and select the cells where you want to change alignment.
- Following this, click the Macros button in the Developer tab.
After completing this step, the Macro wizard appears.
- Now, click Run to execute the Macro.
Just like that, the text in the selected cells becomes right-aligned, it’s that easy.
This article provides quick and easy answers to how to change alignment in excel to the right. Make sure to download the practice files. Hope you found it helpful. Please inform us in the comment section about your experience. We, the Exceldemy team, are happy to answer your queries. Keep learning and keep growing!