Formatting Charts - X/y Axis aligment properties text direct

robtyketto

Board Regular
Joined
Oct 25, 2006
Messages
111
Greetings,

Ive been googling and using the help pages to try and find out the vba code to allow me to format charts x,y axis titles text direction.

I tried recording the macro and its doesnt generate the full code :(

Here's what I do in excel :-
Right click on the appropriate x or y axis title within the chart -> Format Axis -> Alignment.

Now from here I would like the vba statements to change the text direction parameter (In this particular case I want to rotate text by 270 degrees).

Can anyone help?
Im using excel 2007 btw

Thanks
Rob
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi Rob

For ex., for the X-Axis. Assuming you'll want to change other properties as well, I'd structure the code like this

Code:
    With Worksheets("Sheet1").ChartObjects("Chart 1").Chart
        With .Axes(xlCategory)
            .TickLabels.Orientation = -90
        End With
    End With
 
Upvote 0

Forum statistics

Threads
1,215,349
Messages
6,124,427
Members
449,158
Latest member
burk0007

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top