+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] Find the value of a point with VBA

  1. #1
    Francois
    Guest

    [SOLVED] Find the value of a point with VBA

    Hi all,

    Pardon my english ! I'm french.

    I need to find the values of points of a serie (in charts of course)
    with VBA. I can't refer to the value of the source cells because of the
    very bad organization of the source sheets.

    The only way I found is to add datalabels, pick the datalabels values,
    convert them to numeric values.

    Is there a shorter method to do that ? (XL2K)

    I did not find the answer on the french speaking excel newsgroup though
    it's very active and frendly.

    Thanks

    --
    François L

  2. #2
    Andy Pope
    Guest

    Re: Find the value of a point with VBA

    Hi,

    This will get the values from series 1. Note that linked cells with
    errors or #N/A will not return a value.

    Sub X()
    Dim lngIndex As Long

    On Error Resume Next
    With ActiveChart.SeriesCollection(1)
    For lngIndex = 1 To .Points.Count
    Debug.Print "Series 1 Point "; lngIndex, _
    Application.WorksheetFunction.Index(.Values, lngIndex)
    Next
    End With

    End Sub

    Cheers
    Andy

    Francois wrote:
    > Hi all,
    >
    > Pardon my english ! I'm french.
    >
    > I need to find the values of points of a serie (in charts of course)
    > with VBA. I can't refer to the value of the source cells because of the
    > very bad organization of the source sheets.
    >
    > The only way I found is to add datalabels, pick the datalabels values,
    > convert them to numeric values.
    >
    > Is there a shorter method to do that ? (XL2K)
    >
    > I did not find the answer on the french speaking excel newsgroup though
    > it's very active and frendly.
    >
    > Thanks
    >


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

  3. #3
    Francois
    Guest

    Re: Find the value of a point with VBA

    Andy Pope a écrit :
    > Hi,
    >
    > This will get the values from series 1. Note that linked cells with
    > errors or #N/A will not return a value.
    >
    > (...)


    Hi,

    Thanks a lot. I'll test it as soon as possible. I'm busy with a son of
    mine just now !

    --
    François L

  4. #4
    Francois
    Guest

    Re: Find the value of a point with VBA

    Andy Pope a écrit :
    > Hi,
    >
    > This will get the values from series 1. Note that linked cells with
    > errors or #N/A will not return a value.
    >
    > Sub X()
    > Dim lngIndex As Long
    >
    > On Error Resume Next
    > With ActiveChart.SeriesCollection(1)
    > For lngIndex = 1 To .Points.Count
    > Debug.Print "Series 1 Point "; lngIndex, _
    > Application.WorksheetFunction.Index(.Values, lngIndex)
    > Next
    > End With
    >
    > End Sub
    >


    Hi,

    I tested it and it works exactly as I need. Thanks again.

    --
    François L

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1