Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using SeriesCollection.Extend for a specific Chart Data Series
I have been trying to extend only the second data series in an XY
Scatterchart that has three series in it using the SeriesCollection.Extend method. The VBA code extends all the data series with the new data, not just the 2nd series that I want to extend. My data is laid out in a worksheet called "Sheet1" with the X values in Column A and the Y values in Column B. Let's assume that Series1 has its values in rows 1 to 5, Series2 has its values in rows 6 to 10, and Series3 has its values in rows 11 to 15. These values are already charted in a Chart Sheet called Chart1. Now I want to use VBA to extend my existing chart. I want to extend Series2 by adding the values in rows 16 to 20. I use the following macro: Sub TestExtend() Charts("Chart1").SeriesCollection(2).Select ActiveChart.SeriesCollection.Extend _ Worksheets("Sheet").Range("A16:B20"), xlColumns, True End Sub However, this macro extends all three existing series (1, 2, and 3) with the new data, not just Series2 as I wanted. Any ideas? Please note: I have already determined that the Extend method will only work with a range and not with an array value so the first three dataseries must have been entered as ranges, either programmatically or via the Chart ... Source Data ... Add dialog box. Thanks, Frank |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extend series using ref cell formula transposed | Excel Worksheet Functions | |||
Extend series | Excel Worksheet Functions | |||
chart data series -- plot a table as a single series | Charts and Charting in Excel | |||
How do I color specific data series based on location on data she | Charts and Charting in Excel | |||
how do i extend the series of a portion of a formula? | Excel Worksheet Functions |