Adding rows in a chart

A

Art

Hi
I'm trying to add rows in a chart. This is a line chart, getting the values from a data sheet. It is to create a line from one row of data, then go down a row and add a second row of data. It does this, but replaces the existing line with the new data. How can I get it to not replace the existing data, but add a new line to it? Here is what I have:

(variables - RW is the row, I is the column)

Charts.Add
ActiveChart.ChartType = xlLine
For J = 1 To 15 Step 1
ActiveChart.SetSourceData Source:=Sheets("Data").Cells(RW, I).Offset(0, -9).Resize(1, 10), PlotBy:=xlRows
ActiveChart.SeriesCollection(1).Name = Worksheets("Data").Cells(RW, 1).Value
RW = RW + 1
Next J


Thanks. Art
 
J

Jon Peltier

Art -

Add a new series:

For J = 1 To 15 Step 1
ActiveChart.SeriesCollection.Add Source:=Sheets("Data").Cells(RW,
I).Offset(0, -9).Resize(1, 10), RowCol:=xlRows
ActiveChart.SeriesCollection(J).Name = Worksheets("Data").Cells(RW, 1).Value
RW = RW + 1
Next J

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Top