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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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