close

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

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 quot;Series 1 Point quot;; lngIndex, _
Application.WorksheetFunction.Index(.Values, lngIndex)
Next
End With

End Sub

Cheers
Andy

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

--

Andy Pope, Microsoft MVP - Excel
www.andypope.info

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

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

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

Hi,

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

--
François L

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()