Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adjust series order in Excel 2007
We are trying to automate the creation of a column chart with two data
series, wherein one of the series is attached to the secondary axis. We create two additional 'dummy' or blank series with zero values (two series attached to primary axis; two series attached to secondary axis) so the secondary column series does not 'jump' in front of the primary column series. We cannot dictate the order of the series on the worksheet to the user, so we need to be able to adjust the series order. Does anyone know the code to manipulate the series order in Excel 2007? Thank you very much. Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adjust series order in Excel 2007
There is a property you can set in the Series object to move to
secondary axis. The following line will move the first series of the active chart to the secondary axis: ActiveChart.SeriesCollection(1).AxisGroup = xlSecondary If you want to change the order of their appearance, you have to do it by chart group. This code will cause the first series of the first chart group of the active chart to be plotted second: ActiveChart.ChartGroups(1).SeriesCollection(1).Plo tOrder = 2 Hope that helps. On Dec 13, 10:59 am, MikeM_work wrote: We are trying to automate the creation of a column chart with two data series, wherein one of the series is attached to the secondary axis. We create two additional 'dummy' or blank series with zero values (two series attached to primary axis; two series attached to secondary axis) so the secondary column series does not 'jump' in front of the primary column series. We cannot dictate the order of the series on the worksheet to the user, so we need to be able to adjust the series order. Does anyone know the code to manipulate the series order in Excel 2007? Thank you very much. Mike |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adjust series order in Excel 2007
ilia:
Thanks a million; you've put us on the right track! Mike "ilia" wrote: There is a property you can set in the Series object to move to secondary axis. The following line will move the first series of the active chart to the secondary axis: ActiveChart.SeriesCollection(1).AxisGroup = xlSecondary If you want to change the order of their appearance, you have to do it by chart group. This code will cause the first series of the first chart group of the active chart to be plotted second: ActiveChart.ChartGroups(1).SeriesCollection(1).Plo tOrder = 2 Hope that helps. On Dec 13, 10:59 am, MikeM_work wrote: We are trying to automate the creation of a column chart with two data series, wherein one of the series is attached to the secondary axis. We create two additional 'dummy' or blank series with zero values (two series attached to primary axis; two series attached to secondary axis) so the secondary column series does not 'jump' in front of the primary column series. We cannot dictate the order of the series on the worksheet to the user, so we need to be able to adjust the series order. Does anyone know the code to manipulate the series order in Excel 2007? Thank you very much. Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
For chart syles, why doesn't color order match series order? | Charts and Charting in Excel | |||
line series order Excel 2007 | Charts and Charting in Excel | |||
How do I change the legend Series order in Excel 2007? | Excel Discussion (Misc queries) | |||
How do I change the Series plotting order in Excel 2007? | Excel Discussion (Misc queries) | |||
Excel, How do I get rows to adjust to cronological order of date | Excel Discussion (Misc queries) |