Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
 
Posts: n/a
Default vba charting question

Suppose I have three range objects, call them XRange, DataRange and
DataLabelsRange.

- XRange is a series of months, e.g. Jan 2005, Feb 2005 ... etc.

- DataRange contains several series of data for each month. For
example data for North Sales, South Sales, etc.

- DataLabelsRange contains the actual labels "North Sales", "South
Sales", etc.

The goal is use VBA to create a chart from this ranges with the months
on the x axis, lines for each of the series on the y axis, and a legend
labeling the lines for you. Pretty simple, no? But after goofing
around with the seriescollection object for a couple of hours I can't
figure it out.

For reasons I won't go into, I can't just select these three ranges as
one block and have Excel figure out the rest. I need to take these
three separate ranges and somehow meld them into a graph using VBA.

Any advice would be much appreciated--thanks!

  #3   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default vba charting question

This page has some simple VBA examples that should get you started:

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

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

wrote in message
oups.com...
Suppose I have three range objects, call them XRange, DataRange and
DataLabelsRange.

- XRange is a series of months, e.g. Jan 2005, Feb 2005 ... etc.

- DataRange contains several series of data for each month. For
example data for North Sales, South Sales, etc.

- DataLabelsRange contains the actual labels "North Sales", "South
Sales", etc.

The goal is use VBA to create a chart from this ranges with the months
on the x axis, lines for each of the series on the y axis, and a legend
labeling the lines for you. Pretty simple, no? But after goofing
around with the seriescollection object for a couple of hours I can't
figure it out.

For reasons I won't go into, I can't just select these three ranges as
one block and have Excel figure out the rest. I need to take these
three separate ranges and somehow meld them into a graph using VBA.

Any advice would be much appreciated--thanks!



  #4   Report Post  
Posted to microsoft.public.excel.charting
 
Posts: n/a
Default vba charting question

Thanks Jon. I actually visited your site before posting, but I'm still
a little confused.

Here's what my data looks like:

date1 date2 date3
seriestitle1
seriestitle2 series data range A
seriestitle3
----------------------------------------------------
seriestitle4
seriestitle5 series data range B
seriestitle6

I have used VBA to identify the ranges corrseponding to A and B. I
could use the setsourcedata method to graph data range A with titles
and dates. But I can't do that for data range B.

Your website says, "You are not limited to using SetSourceData to
define the data being charted. You can add the series one-by-one,
selecting the precise data you want, not what Excel will assume you
want." It would be extremely helpful if you could give me a hint on
how to do this.

  #5   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier
 
Posts: n/a
Default vba charting question

Pick one of these techniques:

http://peltiertech.com/Excel/ChartsH...html#addseries

and put it into a loop which iterates each series.

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

wrote in message
oups.com...
Thanks Jon. I actually visited your site before posting, but I'm still
a little confused.

Here's what my data looks like:

date1 date2 date3
seriestitle1
seriestitle2 series data range A
seriestitle3
----------------------------------------------------
seriestitle4
seriestitle5 series data range B
seriestitle6

I have used VBA to identify the ranges corrseponding to A and B. I
could use the setsourcedata method to graph data range A with titles
and dates. But I can't do that for data range B.

Your website says, "You are not limited to using SetSourceData to
define the data being charted. You can add the series one-by-one,
selecting the precise data you want, not what Excel will assume you
want." It would be extremely helpful if you could give me a hint on
how to do this.





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
quick charting question for similar charts on multiple sheets Boon8888 Charts and Charting in Excel 2 January 27th 06 07:33 PM
Charting Question sfrancoe Excel Discussion (Misc queries) 8 January 18th 06 10:32 PM
Dynamic Charting Question Barb Reinhardt Charts and Charting in Excel 4 January 11th 06 04:53 PM
Pivot table question gary Excel Discussion (Misc queries) 1 January 10th 06 06:25 PM
Simple charting question codetalker Charts and Charting in Excel 1 January 31st 05 04:13 AM


All times are GMT +1. The time now is 08:45 AM.

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

About Us

"It's about Microsoft Excel"