Returning a series collection end Point value

D

Dan Thompson

Hi there,

I would like to be able to return the data label as well as the value from
the last point of a series collection on my chart.

Now I can use this code to find the end point in my series collection

P = ActiveChart.SeriesCollection(1).Points.Count

However once I have found the end point I want to return the data value and
the DataLable (ie.. Dec 06, Jan 07 Date corisponding to my X-Axis)

I have tried this code but it doesn't work

P = ActiveChart.SeriesCollection(1).Points.Count
X = ActiveChart.SeriesCollection(1).Points(P).Value

also have tried this ..
P = ActiveChart.SeriesCollection(1).Points.Count
X = ActiveChart.SeriesCollection(1).Points(P).Datalabel.Value

neither o these methods have worked I NEED HELP PLEASE !

Dan Thompson
 
J

Jon Peltier

Dan -

Try these:

P = ActiveChart.SeriesCollection(1).Points.Count
X = WorksheetFunction.Index(ActiveChart.SeriesCollection(1).XValues, P)
Y = WorksheetFunction.Index(ActiveChart.SeriesCollection(1).Values, P)
S = ActiveChart.SeriesCollection(1).Points(P).DataLabel.Text

- Jon
 
D

Dan Thompson

Thanks for your input. Sorry I didn't see your post untill today Feb 23, 2007
Your code all works except for the last line I get an Error on that one.
Any better Ideas or code that will work for what I am trying to do ??
 

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