PC Review


Reply
Thread Tools Rate Thread

how do i get get worksheet name for pivottable sourcedata whenworking on pivotchart

 
 
minimaster
Guest
Posts: n/a
 
      26th Nov 2007
Hello,

I'm working with a pivotchart and like to identify the worksheet or
the worksheet name where the sourcedata is present for the
pivotchart / the pivottable. The code needs to work with named ranges
as sourcedata for the pivottable.

Dim pt As PivotTable
Dim ws as Range

Set pt = ActiveChart.PivotLayout.PivotTable


' handle to the worksheet with the pivottable sourcedata
' Set WS = Worksheets(Left(pt.SourceData, InStr(1, pt.SourceData,
"!", vbTextCompare) - 1)).[a1]
sp = Range(pt.SourceData).Parent.Name

Set WS = Worksheets(sp)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I get the worksheet with the pivottable sourcedata whenworking with a pivotchart ? minimaster Microsoft Excel Programming 4 29th Nov 2007 10:27 AM
HOW TO: PivotTable.SourceData =?Utf-8?B?S2V2aW4gTWNDYXJ0bmV5?= Microsoft Excel Programming 1 22nd Aug 2006 05:16 PM
HOW TO: PivotTable.SourceData =?Utf-8?B?S2V2aW4gTWNDYXJ0bmV5?= Microsoft Excel Programming 1 22nd Aug 2006 04:05 PM
How to use ADO to change Pivottable sourcedata query =?Utf-8?B?Q2hhY2U=?= Microsoft Excel Programming 0 17th May 2005 06:44 PM
Change SourceData in Excel PivotTable via VBA CarlsonClan Microsoft Excel Programming 1 9th Apr 2004 04:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:19 PM.