VB Chart

I

ilonachka

I have a sheet with the following type of data:

Type Value Date
A $100 01/08
A $200 02/08
B $50 06/07
B $22 05/08

I'm creating a chart and setting the x-axis as Date, the y-axis as
Value and need 2 stacked lines each representing a type.

I set the X as Date

ActiveChart.SeriesCollection(1).XValues = WorkWk.Range("C2", EndStr)

with WorkWk = current worksheet and EndStr being the end of the
column, so C5 in the example above and that resets the y-axis to
Column B. So how would I make the 2 types each its own line on the
graph?

Thanks,
Ilona
 
J

Jon Peltier

You need two series, one with dates in C2:C3, the other with dates in C4:C5.

It won't work to stack the lines, though, if the dates are different. In a
line chart, all series assume the X values of the first series.

To split a range into multiple series, you could try these technique
(adjusted to match your data layout):

http://peltiertech.com/WordPress/2008/05/22/vba-to-split-data-range-into-multiple-chart-series/
http://peltiertech.com/WordPress/2008/05/23/split-data-range-into-multiple-chart-series-without-vba/

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top