How to Rotate Text in Excel

Get FREE Advanced Excel Exercises with Solutions!

In this article, we have discussed 5 different ways in Excel to rotate text. We have also shown you how to rotate text at any custom angle. Then, we explored different methods to change text orientation to horizontal. Lastly, we have explored text alignment options in Excel.

One can take measures in Excel to rotate text to enhance data presentation and enable reading in a small space. It is necessary to rotate text to fit text in narrow columns. Certain text orientations improve the readability of the user.

Excel Rotate Text


Download Practice Workbook

You can download this practice workbook while going through the article.


How to Rotate Text in Excel

We will use the following dataset to show various methods in Excel to rotate text.

Sales of Products


1. Use Ribbon Alignment Option

  • Select range B4:F4 >> go to the Home tab >> select Orientation from the Alignment group.
  • Select Angle Counterclockwise to rotate your text 45 degrees counterclockwise.

Ribbon Alignment Option

You can also rotate your text in other provided directions from the list.

  • You will see the text rotation in range B4:F4.

Rotate Text with Ribbon Alignment Option

Note:
Repeat the same steps to change the text into a horizontal orientation.

2. Use Format Cells Dialog Box

  • Select range B4:F4 >> go to the Home tab >> select Orientation from the Alignment group >> select Format Cell Alignment option.

Format Cell Alignment Option

  • Select the Alignment tab of the Format Cells dialog box.
  • Put 45 in the Degrees bar and press OK.

Format Cells Dialog Box

  • You will see the text rotation in range B4:F4.

Use Format Cells Dialog Box to Rotate Text


3. Keyboard Shortcut to Rotate Text

  • Select range B4:F4.
  • Press Alt + H and you will see various shortcuts for the options of the Home tab.

Use Keyboard Shortcut

Choose Angle Counterclockwise Option

  • You will see the rotated text in range B4:F4.

Apply Keyboard Shortcut to Rotate Text

Note:
Repeat the same steps to change the text into a horizontal orientation.

4. VBA Code to Rotate Text in Excel

We will use the same dataset.

Sample Dataset

  • Go to the Developer tab >> Visual Basic.

Open Visual Basic

  • Select Insert >> Module.

Create New Module

  • Paste this VBA code in the VBA Macro Editor.
  • Press the Run button or F5 key to run the code.

VBA Macro Editor

Sub Rotate_Text()
    'variable declaration
    Dim WS As Worksheet
    Dim myRng As Range
    'set variable
    Set WS = ActiveSheet
    Set myRng = WS.Range("B4:F4")
    'rotate text
    With myRng
        .Orientation = 45
    End With
End Sub
  • You will see the text rotation in range B4:F4.

Using VBA Code to Rotate Text

Note:
With myRng
        .Orientation = 45
End With

This portion of the code sets the orientation of myRng range to 45 degrees. It displays the texts in that range of cells in 45 degrees counterclockwise direction.


5. Rotate Axis Label in Excel Charts

  • Select range B4:F5 >> go to the Insert tab >> select Line Chart from the Charts group >> choose any chart.

Create Chart from Dataset

  • You will see the chart in your worksheet. Give it an appropriate title.

Excel Chart with Label

  • Right-click on the x-axis label >> select Format Axis.

Choose Format Axis Option

  • Format Axis menu will open on the right side of the worksheet.
  • Select Size & Properties.
  • Type -45 in the Custom angle bar to rotate the axis label 45 degrees counterclockwise.

Format Axis Context Menu

  • You will see the rotation of the x-axis label.

Rotate Axis Label in Excel Chart


How to Rotate Text in Excel at a Custom Angle

  • Select range B4:F4 >> go to the Home tab >> select Orientation from the Alignment group >> select Format Cell Alignment option.

Choose Format Cell Alignment Option

  • This will open the Alignment tab of the Format Cells dialog box.
  • You can rotate the text at any angle you want. Put 90 in the Degrees bar to rotate the text vertically and press OK.

Alignment Tab of Format Cells Dialog Box

Rotate Text at Custom Angle


How to Change the Text Orientation Back to Horizontal

1. Use Format Cells Dialog Box

  • Select range B4:F4.
  • Open the Alignment tab of the Format Cells dialog box following the previous method.

Select Format Cell Alignment from Orientation Option

  • Put 0 in the Degrees bar and click OK.

Format Cells Dialog Box

  • The text will change back to horizontal orientation.

Use Format Cells Dialog Box to Make Text Horizontal


2. Apply VBA Macro

  • Open VBA Macro Editor >> paste the following code in the window >> press the Run button or F5 key to run the code.

Insert VBA Code in VBA Macro Editor

Sub Rotate_Text_Horizontal()
    'variable declaration
    Dim WS As Worksheet
    Dim myRng As Range
    'set variable
    Set WS = ActiveSheet
    Set myRng = WS.Range("B4:F4")
    'rotate text
    With myRng
        .Orientation = 0
    End With
End Sub
  • You will see the texts in range B4:H4 in horizontal direction.

Use VBA Macro to Make Text Horizontal


How to Align a Column or Row

  • Select range B4:F14. You can choose a single cell, a range of cells, a column or columns, a row or rows, or even the entire worksheet.
  • Go to the Home tab >> select a vertical alignment option.

Vertical Alignment

  • Similarly, select a horizontal alignment option.

Horizontal Alignment


Why Rotate Text in Excel?

  • To satisfy users’ preferences.
  • To fit the width of the content in the column.
  • To give a different perspective to a particular text.
  • To make longer text contents visible.
  • To improve the overall appearance of your worksheet.
  • To accommodate longer text in a smaller space.

Things to Remember

There are a few things to remember in Excel to rotate text.

  • Select the proper cell or range of cells.
  • Navigate to the Alignment tab while using the Format Cells dialog box.
  • Adjust column width and height accordingly.

Frequently Asked Questions

1. Will rotating text in Excel affect the cell’s formatting or alignment?

No, text rotating in Excel does not affect the formatting or alignment of the cell. However, you may need to adjust the height and width of the cell.

2. Can I rotate only a portion of the text within a cell in Excel?

No, Excel does not provide an option to rotate only a portion of the text within a cell.

3. Can I rotate text vertically in Excel?

Yes, you can rotate text vertically or at 90 degrees in Excel.


Excel Rotate Text: Knowledge Hub


Conclusion

In this article, we have presented various methods in Excel to rotate text. We have also offered methods to get texts in horizontal orientation. If you have any questions regarding this essay, don’t hesitate to let us know in the comments. Also, if you want to see more Excel content like this, please visit our website, and unlock a great resource for Excel-related content.


<< Go Back to Text Formatting | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Md. Abu Sina Ibne Albaruni
Md. Abu Sina Ibne Albaruni

Md. Abu Sina Ibne Albaruni holds a BSc in Mechanical Engineering from Bangladesh University of Engineering and Technology. He is a dedicated employee of the ExcelDemy project. He has written quite a large number of articles for ExcelDemy. Besides, he has expertise in VBA. He efficiently automates Excel issues using VBA macros and actively engages in the ExcelDemy forum, offering valuable solutions for user interface challenges. His areas of interest in work and study span MATLAB, Machine Learning,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo