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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,218,522
Messages
6,142,956
Members
450,456
Latest member
Exidur

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