Walk over all the points in a series and extract the X value?

C

Chrisso

Hi

I am using a standard clustered column chart in Excel 2003.

I would like to be able to walk over all the points in a series and
extract the X value for inspection.

Is this possible? I cannot see how to do this.

Thanks in advance,
Chrisso
 
C

Chrisso

Hi

I am using a standard clustered column chart in Excel 2003.

I would like to be able to walk over all the points in a series and
extract the X value for inspection.

Is this possible? I cannot see how to do this.

Thanks in advance,
Chrisso

I should have stated that I have the code to walk over the points - I
just cannot see how to extract the X value for each point:

Dim cht As Chart, ser As Series
Set cht = ActiveChart
Set ser = cht.SeriesCollection(1)
Dim pt As Point
For Each pt In ser.Points
' ## how do I get the X value for pt?
Next pt

Cheers
Chrisso
 
T

Tushar Mehta

Use
Dim cht As Chart, ser As Series
Set cht = ActiveChart
Set ser = cht.SeriesCollection(1)
Dim I As Integer
For I = 1 To ser.Points.Count
Debug.Print I & ": " & ser.XValues(I)
Next I

I should have stated that I have the code to walk over the points - I
just cannot see how to extract the X value for each point:

Dim cht As Chart, ser As Series
Set cht = ActiveChart
Set ser = cht.SeriesCollection(1)
Dim pt As Point
For Each pt In ser.Points
' ## how do I get the X value for pt?
Next pt

Cheers
Chrisso
Regards,

Tushar Mehta
Microsoft MVP Excel 2000-present
www.tushar-mehta.com
Excel and PowerPoint tutorials and add-ins
 
C

Chrisso

Thanks Tushar - just what I needed.

Chris

Use
    Dim cht As Chart, ser As Series
    Set cht = ActiveChart
    Set ser = cht.SeriesCollection(1)
    Dim I As Integer
    For I = 1 To ser.Points.Count
        Debug.Print I & ": " & ser.XValues(I)
        Next I






Regards,

Tushar Mehta
Microsoft MVP Excel 2000-presentwww.tushar-mehta.com
Excel and PowerPoint tutorials and add-ins- Hide quoted text -

- Show quoted text -
 

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