Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
JessK
 
Posts: n/a
Default Adding data series to chart via macro

I have a macro that adds rows of data to a summary table. I would like to
update my chart by adding a new series for each new row of data, but the
ActiveChart.SeriesCollection(N) command will not accept a variable for N.

for example, the command will add Data series # 3 with N=3, but if I create
a variable "run_num" set equal to the # of the current data series (ie,
run_num = Range("A5").Value), then the command does not work.

How can this be done so that the added series increments each time the macro
adds a new row of data?

  #2   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default Adding data series to chart via macro

That line of code should be fine. You didn't share with us the code leading
up to it, the error description, the value of N, the number of series in the
chart (did you make sure you have at least N series?), the data in the
source data range.

There are some VBA-Chart code examples on this web page which you may find
helpful:

http://peltiertech.com/Excel/ChartsH...kChartVBA.html

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

"JessK" wrote in message
...
I have a macro that adds rows of data to a summary table. I would like to
update my chart by adding a new series for each new row of data, but the
ActiveChart.SeriesCollection(N) command will not accept a variable for N.

for example, the command will add Data series # 3 with N=3, but if I
create
a variable "run_num" set equal to the # of the current data series (ie,
run_num = Range("A5").Value), then the command does not work.

How can this be done so that the added series increments each time the
macro
adds a new row of data?



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
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
Pivot Chart - X,Y & Data Series Options Graham Haslehurst Charts and Charting in Excel 4 November 24th 05 02:51 PM
Transparent Chart Data Series stevepain Excel Discussion (Misc queries) 0 September 26th 05 04:43 PM
Help! I'm losing one series of data in an overlay chart. Charts are Us Charts and Charting in Excel 1 January 4th 05 05:57 PM
Extending a Chart Data Series from an Array - Can it be done? Jon Peltier Charts and Charting in Excel 4 November 30th 04 03:30 AM


All times are GMT +1. The time now is 02:35 PM.

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"