Setting Axis Title Orientation in VBA

MrPogle

New Member
Joined
Dec 11, 2008
Messages
8
I am trying to use the ActiveChart.SetElement method to turn a secondary y-axis title to face inwards i.e. the title is on the right of the chart but I want its base to be on the left of the now vertical box (turning your head to the right to read it).

The options prompted with .SetElement are:

.SetElement (msoElementSecondaryValueAxisTitleRotated)
.SetElement (msoElementSecondaryValueAxisTitleHorizontal)
.SetElement (msoElementSecondaryValueAxisTitleNone)
.SetElement (msoElementSecondaryValueAxisTitleVertical)

None of which give me what I need.

The equivalent done manually is "Rotate All Text 90 (degrees)"

.SetElement (msoElementSecondaryValueAxisTitleRotated) is the equivalent of "Rotate All Text 270 (degrees)"
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
How about something like this instead:
Code:
    With ActiveChart.Axes(xlValue, xlSecondary)
        .AxisTitle.Orientation = -4170
    End With
?
 
Upvote 0
Same as Glenn's

Code:
    With ActiveChart.Axes(xlValue, xlSecondary)
        .AxisTitle.Orientation = xlDownward
    End With
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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