Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change axis value labels orientation?

I have a chart in Excel; I need to change orientation of text labels in one of the axis programmatically. Ideas?

like image 689
user626528 Avatar asked Jun 10 '11 08:06

user626528


2 Answers

This will change the orientation of the X-axis tick labels.

ActiveChart.Axes(xlCategory).TickLabels.Orientation = 45 ' degrees

This is how to change the orientation of the axis title:

ActiveChart.Axes(xlCategory).AxisTitle.Orientation = 81 ' degrees

Have you ever tried recording macros? If not, you should! Looking at the resulting code is a great way to quickly learn this type of thing.

like image 160
Jean-François Corbett Avatar answered Oct 09 '22 22:10

Jean-François Corbett


Layout tab (which appears when you have a chart selected) -> labels -> axis titles.

or

Right click the chart axis -> format axis -> Alignment

or

VBA solution as Jean-François Corbett pointed out

like image 22
Alen Avatar answered Oct 09 '22 22:10

Alen