How to change font properties of chart axes

好久不见. 提交于 2019-12-23 11:51:04

问题


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?


回答1:


Use this:

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

Source: MS Ref link



来源:https://stackoverflow.com/questions/27028681/how-to-change-font-properties-of-chart-axes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!