Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format axis?

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
NL
i just create a chart which category axis is the company name, in the worksheet, the font name of company name is 'Times New Man', Size 12, Ragular. but in the chart the font name is 'Arial', change the font name in chart simply click category axis, and then format axis, but i was trying to do it in the code, i wouldn't be able to do it, how to write it? the information in the help of excel vba is all about axis title, nothing about axis, thanks a lot if anyone would be able to help me.
 
Hi xq - try this:
ActiveSheet.ChartObjects("Chart Name").Activate
ActiveChart.Axes(xlCategory).Select
With Selection.TickLabels.Font
.Name = "Times New Roman"
.FontStyle = "Regular"
.Size = 12
End With

I got this from recording the action with the Macro Recorder - it's always worth a try if you're just trying to code something that can easily be done manually

HTH
~Geoff~
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top