Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
art art is offline
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding line chart w/ 2nd axis to stacked bar chart Greg Yedinak Charts and Charting in Excel 1 January 12th 09 10:51 PM
Adding rows James Excel Discussion (Misc queries) 5 December 31st 08 07:53 PM
Adding rows based on no of rows specified from a given position nanette Excel Worksheet Functions 1 July 9th 08 02:29 PM
Adding five new rows every 40 rows in a spreadsheet? Olzki Excel Discussion (Misc queries) 8 May 18th 07 02:14 AM
Adding Rows offsets to working rows across two worksheets tom Setting up and Configuration of Excel 3 July 30th 06 07:54 PM


All times are GMT +1. The time now is 11:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"