Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -----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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Column chart with two axes | Charts and Charting in Excel | |||
Code about setting Y Axes scale. | Charts and Charting in Excel | |||
Having two X-axes on same chart | Excel Discussion (Misc queries) | |||
Setting axes for 3-dimensional charts | Charts and Charting in Excel | |||
XY-Chart with 4 axes | Charts and Charting in Excel |