Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default VBA to set the font size for the axes of a bar chart

I trying to set the font size on the axes of a horizontal stacked bar
chart (Excel 2010). When I try to run the code created by the macro
recorder I get an error message: Method of 'TextFrame2' of object
'ChartFormat' failed

Here is the offending code:

ActiveChart.Axes(xlValue).Select
Selection.Format.TextFrame2.TextRange.Font.Size = 10

Can anyone tell me how to set the font size of the chart axes with VBA
please?
Any help would be greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default VBA to set the font size for the axes of a bar chart

On Sep 6, 8:08*pm, Harry Flashman wrote:
I trying to set the font size on the axes of a horizontal stacked bar
chart (Excel 2010). When I try to run the code created by the macro
recorder I get an error message: Method of 'TextFrame2' of object
'ChartFormat' failed

Here is the offending code:

ActiveChart.Axes(xlValue).Select
* * Selection.Format.TextFrame2.TextRange.Font.Size = 10

Can anyone tell me how to set the font size of the chart axes with VBA
please?
Any help would be greatly appreciated.


Okay I am an idiot. After struggling with this problem for over an
hour I post here and then exactly 2 minutes later I figure it out.


ActiveChart.Axes(xlValue).TickLabels.Font.Size = 10
ActiveChart.Axes(xlCategory).TickLabels.Font.Size = 8
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart series legend font size keeps shrinking - how to stop it? IanQa Charts and Charting in Excel 0 February 4th 10 08:49 PM
Changing font style/size/color/etc for multiple series in a chart? Hossdaddy Charts and Charting in Excel 3 January 14th 10 07:36 PM
changing font size of chart title Kathl Excel Programming 2 April 30th 08 08:13 AM
really weird behavior, chart with textbox font size problem xlrotor[_2_] Excel Programming 1 February 26th 08 10:11 PM
Font Size in Chart Title Bill[_30_] Excel Programming 1 July 14th 06 04:06 PM


All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"