Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default setting chart axes


-----Original Message-----
I am attempting to give all of my charts the same scale

and font size using a Macro. When I attempt to run the
following code, it breaks after a few iterations and then
says that it is 'Unable to get the chartobjects property
of the worksheetclass'
What's wrong?

Sub macrotitlesize()
For i = 0 To 12
ActiveSheet.ChartObjects(i + 1).Activate
ActiveChart.Axes(xlCategory).MajorUnitScale = xlYears
ActiveChart.Axes(xlCategory).MinorUnitScale = xlMonths
ActiveChart.Axes(xlCategory).Crosses = xlCustom
ActiveChart.Axes(xlCategory).AxisBetweenCategories =

True
ActiveChart.Axes(xlCategory).ReversePlotOrder = False
ActiveChart.Axes(xlCategory).MinimumScale = "1/1/2000"
ActiveChart.Axes(xlCategory).MaximumScaleIsAuto = True
ActiveChart.Axes(xlCategory).MajorUnit = 1
ActiveChart.Axes(xlCategory).MinimumScale = "1/1/2000"
ActiveChart.Axes(xlCategory).MaximumScaleIsAuto = True
ActiveChart.Axes(xlCategory).MinorUnitIsAuto = True
ActiveChart.Axes(xlCategory).MinorUnit = 1
ActiveChart.Axes(xlCategory).CrossesAt = "1/1/2000"
Next i
End Sub

.Try for each cht in activesheet.chartobjects for the

start of your for next loop. then use activesheet.chart
(cht).

I think that should help any probs drop another post on
this and address it to me and i'll look a little deeper
into it.

Nath



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
Column chart with two axes Greenfield Charts and Charting in Excel 1 May 19th 08 07:59 PM
Code about setting Y Axes scale. fujing1003[_2_] Charts and Charting in Excel 3 December 11th 07 11:29 AM
Having two X-axes on same chart Boon8888 Excel Discussion (Misc queries) 1 March 23rd 06 08:49 PM
Setting axes for 3-dimensional charts owc Charts and Charting in Excel 0 March 17th 06 07:20 PM
XY-Chart with 4 axes monir Charts and Charting in Excel 3 December 3rd 05 09:57 PM


All times are GMT +1. The time now is 07:14 PM.

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"