Programmatically changing Chart axis text orientation

Posted on 2003-02-25
Medium Priority
Last Modified: 2012-06-27
Is it possible to programmatically change the chart axis text orientation in excel/vba?

I need to be able to do change the orientation in the same as right-clicking on a chart axis and then selecting:
Format Axis...
Alignment tab
And the moving the pointer to indicate orientation of text

Question by:JKA
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

bullethead earned 600 total points
ID: 8017884
What you need is:

Sub ChangeOrient()
    ActiveChart.Axes(xlCategory).TickLabels.Orientation = 45
End sub

for example, to set an angle of 45 degrees.

As a more general tip - if you record yourself doing something in Excel by going to Tools\Macro\Record, youc an find out what you need to know and learn VBA in the process.

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question