VBA Charting

C

cwoods

Hi I am tryng to write a program in excel which will automatically create a
new series and add it to a chart. I need to create a new series from C2 and
C3 when C1 changes
The data to be plotted is numeric from C2 (X) and C3(Y), and C1 is alpha
numeric for example, in this case 3 series would be created and added to the
chart
C1 C2 C3
1A 0.5 400
1A 2 1000
2B 35 5000
3D 20 2000
3D 25 2500
3D 20 3000
 
P

Patricia Shanahan

cwoods said:
Hi I am tryng to write a program in excel which will automatically create a
new series and add it to a chart. I need to create a new series from C2 and
C3 when C1 changes
The data to be plotted is numeric from C2 (X) and C3(Y), and C1 is alpha
numeric for example, in this case 3 series would be created and added to the
chart
C1 C2 C3
1A 0.5 400
1A 2 1000
2B 35 5000
3D 20 2000
3D 25 2500
3D 20 3000

I'm not a VBA expert, but I have written some chart-generating code. The
key is the Chart object. For Excel 2007, see
http://msdn.microsoft.com/en-us/library/bb244248.aspx. So far, using the
Chart object and its attributes, I've been able to do all the formatting
and control that I've wanted.

For changing the source data range after the chart has been created, see
the SetSourceData method. Note that you only need it if the limits of
the range change. Changes in the values within the source data range
change the chart automatically.

If this does not help, perhaps you could ask more specific questions. I
*may* be able to answer them.

Patricia
 

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