View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
INTP56 INTP56 is offline
external usenet poster
 
Posts: 66
Default Find source WS from Chart

I have a case where I want to branch code when a user clicks on a Toolbar
button when a chart is the active sheet. I want to find out where the source
data from the chart is coming from. My initial thought was to use .XValues,
and branch my code based on the location of the source data.

When I have the Chart Active, and go to the Chart Menu and select Source
Data, I get a dialog where I can clearly see the chart knows exactly where
the data is coming from. If I turn on recording, and manipulate that window,
nothing gets recorded.

However, in VBA, when I grab a series, and look as .Values or .XValues, it
returns a variant array. So far, the only way I have been able to determine
the worksheet the .XValues came from is to get Series.Formula, and actually
parse the name out of the string.

Is there a better way of determining where the source data from a chart (or
series really) is coming from?

Thanks, Bob