John Walkenbach solves this missing excel function in 2 ways.
1. He parses the series function. Here's his code:
Function GetChartRange(cht As Chart, series As Integer, _
ValOrX As String) As Range
'cht: A Chart object
'series: Integer representing the Series
'ValOrX: String, either "values" or "xvalues"
Dim Sf As String
Dim CommaCnt As Integer
Dim Commas() As Integer
Dim ListSep As String * 1
Dim Temp As String
Dim i as Integer
Set GetChartRange = Nothing
On Error Resume Next
'Get the SERIES formula
Sf = cht.SeriesCollection(series).Formula
'Check for noncontiguous ranges by counting commas
'Also, store the character position of the commas
CommaCnt = 0
ListSep = Application.International(xlListSeparator)
For i = 1 To Len(Sf)
If Mid(Sf, i, 1) = ListSep Then
CommaCnt = CommaCnt + 1
ReDim Preserve Commas(CommaCnt)
Commas(CommaCnt) = i
End If
Next i
If CommaCnt > 3 Then Exit Function
'XValues or Values?
Select Case UCase(ValOrX)
Case "XVALUES"
'Text between 1st and 2nd commas in SERIES Formula
Temp = Mid(Sf, Commas(1) + 1, Commas(2) - _
Commas(1) - 1)
Set GetChartRange = Range(Temp)
Case "VALUES"
'Text between the 2nd and 3rd commas in SERIES Formula
Temp = Mid(Sf, Commas(2) + 1, Commas(3) - _
Commas(2) - 1)
Set GetChartRange = Range(Temp)
End Select
End Function
and how you might use it:
Set MyChart = ActiveSheet.ChartObjects(1).Chart
Set DataRange = GetChartRange(MyChart, 1, "values")
MsgBox DataRange.Address
This is copied from his book without permission, so here's hoping that he'll see this as free advertising for his work rather than breaking copyright.
2. He uses a class module:
see the bottom of this page for a link to it.