Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font properties of chart axes

How do I change the font properties of chart axes in Excel 2007 & 2010?

NOT the axis title; that one's easy. I'm asking about the font of the axis itelf.

It records equivalent to this in Excel 2010:

shEditSizeScales.ChartObjects("MyChart").Chart.Axes(xlCategory).Format.TextFrame2.TextRange.Font.Size=12

But I get an error on that, and I don't see anything past TextFrame2 in the Watch pane.

Even if I step through the recorded code, it gives me the same error.

I've looked through the object model and I don't see it.

How is it done?

like image 899
Greg Lovern Avatar asked Nov 19 '14 23:11

Greg Lovern


People also ask

How do I change my axis Font?

To change the text font for any chart element, such as a title or axis, right–click the element, and then click Font. When the Font box appears make the changes you want.

How do I change the Font on an axis label in Excel?

Right-click the category axis labels you want to format, and click Font. On the Font tab, choose the formatting options you want.

How do I change axis text in Excel chart?

Use new text for category labels in the chart and leavesource data text unchanged. Right-click the category labels to change, and click Select Data. In Horizontal (Category) Axis Labels, click Edit. In Axis label range, enter the labels you want to use, separated by commas.


1 Answers

Use this:

With ActiveChart.Axes(xlCategory).TickLabels.Font
        '.Bold = msoTrue
        .Size = 18
End With

Source: MS Ref link

like image 175
ZAT Avatar answered Nov 14 '22 23:11

ZAT