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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

PCL

Well-known Member
Joined
Jul 15, 2008
Messages
1,348
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,990
Messages
5,834,742
Members
430,315
Latest member
bobh63

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
Top