Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding rows in a chart
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding rows in a chart
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/ _______ Art wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding line chart w/ 2nd axis to stacked bar chart | Charts and Charting in Excel | |||
Adding rows | Excel Discussion (Misc queries) | |||
Adding rows based on no of rows specified from a given position | Excel Worksheet Functions | |||
Adding five new rows every 40 rows in a spreadsheet? | Excel Discussion (Misc queries) | |||
Adding Rows offsets to working rows across two worksheets | Setting up and Configuration of Excel |