How to Align Right in Excel (5 Simple Methods)

Here are five different ways to align cells to the right in Excel:


Method 1 – Using the Home Ribbon

The most common way to right-align the contents of a cell is to use Excel’s Ribbon tool.

Simply select the cells you want to align, go to the Home tab, and click the Align Right icon in the Alignment section.

Change Alignment in Excel to Right from Home Ribbon


Method 2 – Using the Format Cells Wizard

We can also use the Format Cells dialog box to align cells to the right.

Steps:

  • Select the range B5:D14.
  • Right-click on your mouse and choose Format Cells from the context menu. Or press Ctrl+1.

The Format Cells dialog box will open.

  • Select the Alignment tab.
  • In the Horizontal field, click the drop-down.
  • Choose the Right (Indent) option.
  • Click OK.

Aligning Data to Right with Format Cells Wizard


Method 3 – Applying a Custom Number Format

In this technique, we’ll utilize the Custom option in the Format Cells dialog box.

Steps:

  • Select the range B5:B14, and press Ctrl+1.

The Format Cells dialog box will appear.

  • Go to the Number tab >> Custom >> Type: * @ >> Click OK.

Aligning Text to Right with Custom Number Format

The column will be right-aligned.


Method 4 – Using a Keyboard Shortcut

Steps:

  • Select the data to align.
  • Press ALT+H then A then R.

The data will be aligned on the right.

Read More: How to Center Text in a Cell in Excel


Method 5 – Using Excel VBA

We can completely automate the preceding approaches using VBA code.

Steps:

  • Select the range D5:D14.
  • Navigate to the Developer tab.
  • Click the Visual Basic button, or just press ALT+F11.

  • Go to the Insert tab >> Module.

Apply a VBA Code to Align Text to Right

  • Copy the code below and paste it into the Module window that opens:
'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

Apply a VBA Code to Align Text to Right

  • Save the code.
  • Press F5 or click the green Run button to run the code.

The range D5:D14 is right-aligned.

However, we have other columns which are not right aligned. Yet.

  • Select the remaining left-aligned range B5:C14.
  • Go to the Developer tab and select Macros.

  • In the Macro wizard, select the Macro and click the Run button.

The selected cells will be right-aligned.


Download Practice Workbook


Related Articles


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

Get FREE Advanced Excel Exercises with Solutions!
Al Ikram Amit
Al Ikram Amit

Al Ikram Amit, holding a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, serves as a key Excel & VBA Content Developer at ExcelDemy. Driven by a profound passion for research and innovation, he actively immerses himself in Excel. In his role, Amit not only skillfully addresses complex challenges but also exhibits enthusiasm and expertise in gracefully navigating tough situations, emphasizing his steadfast commitment to consistently delivering exceptional, high-quality content that adds significant... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo