RE: how can I get the worksheet with the pivottable sourcedata when wo
- From: Joel <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 26 Nov 2007 12:48:04 -0800
You don't need the parent. pt is already the chart (a chart is equivalent ot
a sheet). Look at the VBAProject window. You'll see the sheets and the
charts are a the save level in the window.
Set pt = ActiveChart.PivotLayout.PivotTable ' no problem to
' get the pivottable
data = pt.SourceData
"minimaster" wrote:
With VBA I like to add some shapes/text to a Pivotchart. The text.
items are part of the pivottable sourcedata table. With VBA I need to
identify the work*** which contains the sourcedata. I'm wondering
whether is any easy way to get a handle to this sourcedata work***.
If not I would need to analyze the sourcedata string and write a
function that would be using some text functions to retrieve the
work*** name out of the sourcedata string. This would get even more
complicated when the sourcedata string is a dynamic named range.
Anybody an idea how this could be done in a more easy way
Dim pt As PivotTable
Dim ws As Work***
Set pt = ActiveChart.PivotLayout.PivotTable ' no problem to
get the pivottable
Set ws = Range(pt.SourceData).Parent
' I believe this does not work because the work*** is not identified
for the range method. Chicken and egg situation.
- Follow-Ups:
- Re: how can I get the work*** with the pivottable sourcedata when wo
- From: minimaster
- Re: how can I get the work*** with the pivottable sourcedata when wo
- References:
- Prev by Date: RE: Vlookup where value begins with
- Next by Date: Re: With excel 2003 could open .csv file but not in excel 2007.
- Previous by thread: how can I get the work*** with the pivottable sourcedata when working with a pivotchart ?
- Next by thread: Re: how can I get the work*** with the pivottable sourcedata when wo
- Index(es):