Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Don S
 
Posts: n/a
Default Need Formula to display pivot table source data

I have a workbook with multiple worksheets of data from which I create
pivot tables. I need a way to display in a cell above my pivot table
the range name (I use dynamic range names for the source data) of the
source data used. In other words, I need to know which data table the
pivot table used without having to select "Data-Pivot Table-Back" each
time. There are about 50 pivot tables in this workbook and all have
to be updated each month.

Thanks!
Don S
  #2   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You could create a user defined function:

In a regular module in the workbook, enter the following code:

Function PTSource(rng) As String
Dim pt As PivotTable
Set pt = ActiveSheet.Range(rng.Address).PivotTable
PTSource = pt.SourceData
End Function

Then, on the worksheet, type: =PTSource(A3)
Replace the A3 with a reference to a pivot table cell on your worksheet.
Note: this formula won't work for pivot tables created from multiple
consolidation ranges.

Don S wrote:
I have a workbook with multiple worksheets of data from which I create
pivot tables. I need a way to display in a cell above my pivot table
the range name (I use dynamic range names for the source data) of the
source data used. In other words, I need to know which data table the
pivot table used without having to select "Data-Pivot Table-Back" each
time. There are about 50 pivot tables in this workbook and all have
to be updated each month.

Thanks!
Don S



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Don S
 
Posts: n/a
Default

Bless you Debra. I've been trying to do that off and on for months.

It worked like a charm.

Thanks!!!
Don S


On Wed, 23 Feb 2005 12:20:38 -0500, Debra Dalgleish
wrote:

You could create a user defined function:

In a regular module in the workbook, enter the following code:

Function PTSource(rng) As String
Dim pt As PivotTable
Set pt = ActiveSheet.Range(rng.Address).PivotTable
PTSource = pt.SourceData
End Function

Then, on the worksheet, type: =PTSource(A3)
Replace the A3 with a reference to a pivot table cell on your worksheet.
Note: this formula won't work for pivot tables created from multiple
consolidation ranges.

Don S wrote:
I have a workbook with multiple worksheets of data from which I create
pivot tables. I need a way to display in a cell above my pivot table
the range name (I use dynamic range names for the source data) of the
source data used. In other words, I need to know which data table the
pivot table used without having to select "Data-Pivot Table-Back" each
time. There are about 50 pivot tables in this workbook and all have
to be updated each month.

Thanks!
Don S


  #4   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You're welcome. Thanks for letting me know that it worked.

Don S wrote:
Bless you Debra. I've been trying to do that off and on for months.

It worked like a charm.

Thanks!!!
Don S


On Wed, 23 Feb 2005 12:20:38 -0500, Debra Dalgleish
wrote:


You could create a user defined function:

In a regular module in the workbook, enter the following code:

Function PTSource(rng) As String
Dim pt As PivotTable
Set pt = ActiveSheet.Range(rng.Address).PivotTable
PTSource = pt.SourceData
End Function

Then, on the worksheet, type: =PTSource(A3)
Replace the A3 with a reference to a pivot table cell on your worksheet.
Note: this formula won't work for pivot tables created from multiple
consolidation ranges.

Don S wrote:

I have a workbook with multiple worksheets of data from which I create
pivot tables. I need a way to display in a cell above my pivot table
the range name (I use dynamic range names for the source data) of the
source data used. In other words, I need to know which data table the
pivot table used without having to select "Data-Pivot Table-Back" each
time. There are about 50 pivot tables in this workbook and all have
to be updated each month.

Thanks!
Don S





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Using a Pivot Table Calculated Field to get a Unique Count Mike Struckman Excel Worksheet Functions 1 November 22nd 05 05:32 PM
How to do two way lookup for more than 400 row & Coulmn? shital shah Excel Worksheet Functions 5 February 6th 05 11:22 AM
I need to create pivot table for the month but data in days Mikeyh133 Excel Discussion (Misc queries) 2 December 31st 04 07:53 PM
missing data on Pivot table Aannd Excel Discussion (Misc queries) 1 December 21st 04 12:05 AM
Formula to Extract Data from a Table Macshots Excel Worksheet Functions 2 November 5th 04 06:35 AM


All times are GMT +1. The time now is 10:20 PM.

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"