A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding data series to chart via macro



 
 
Thread Tools Display Modes
  #1  
Old March 1st, 2006, 10:37 PM posted to microsoft.public.excel.charting
external usenet poster
 
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  
Old March 1st, 2006, 11:04 PM posted to microsoft.public.excel.charting
external usenet poster
 
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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Data Information to a Chart Mike M Charts and Charting 4 December 17th, 2005 12:12 AM
Can't format all data series on chart PaB General Discussion 0 August 9th, 2005 07:22 PM
strategy for data entry in multiple tables LAF Using Forms 18 April 25th, 2005 04:04 AM
Adding new series to chart with two series types Bill Charts and Charting 1 November 14th, 2004 07:43 PM
SQL view of messed up action queries Kendra Running & Setting Up Queries 2 August 31st, 2004 09:53 PM


All times are GMT +1. The time now is 01:22 PM.


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