Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default how do i get get worksheet name for pivottable sourcedata whenworking on pivotchart

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
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
Is a PivotTable/PivotChart the right tool to use for this? winterminute Charts and Charting in Excel 0 January 18th 11 01:05 AM
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 06:22 AM.

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

About Us

"It's about Microsoft Excel"