LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default how can I get the worksheet with the pivottable sourcedata whenworking with a pivotchart ?

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 worksheet which contains the sourcedata. I'm wondering
whether is any easy way to get a handle to this sourcedata worksheet.
If not I would need to analyze the sourcedata string and write a
function that would be using some text functions to retrieve the
worksheet 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 Worksheet

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 worksheet is not identified
for the range method. Chicken and egg situation.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i get get worksheet name for pivottable sourcedata whenworking on pivotchart minimaster Excel Programming 0 November 26th 07 03:17 PM
HOW TO: PivotTable.SourceData Kevin McCartney Excel Programming 1 August 22nd 06 05:16 PM
HOW TO: PivotTable.SourceData Kevin McCartney Excel Programming 1 August 22nd 06 04:05 PM
How to use ADO to change Pivottable sourcedata query Chace Excel Programming 0 May 17th 05 06:44 PM
Change SourceData in Excel PivotTable via VBA CarlsonClan Excel Programming 1 April 9th 04 04:15 AM


All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"