Show Excel Pivot Table Source in Cell

PaulL

New Member
Joined
Mar 26, 2009
Messages
2
I'm creating a pivot table for some accounting auditors. They would like me to show the Source Spreadsheet name in a cell at the top of the Pivot Table sheet for documentation.

Is there a way to do this?

Thanks

Paul
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Next UDF could help.
Assuming Pivot Table name is PT_Test
In a cell somewhere = sheet_Name("PT_Test")

Code:
Option Explicit
Function SHEET_NAME(TABLE_NAME As String) As String
    Dim PT As PivotTable
    Dim I As Integer
    On Error GoTo NO_PT
    Set PT = ActiveSheet.PivotTables(TABLE_NAME)
    SHEET_NAME = PT.SourceData
    I = InStr(PT.SourceData, "!")
    SHEET_NAME = Left(SHEET_NAME, I - 1)
NO_PT:
End Function
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top