Pivot Table Label vs Orignal Data Column Name

  • Thread starter Thread starter Ann
  • Start date Start date
A

Ann

How can I go back and find a column name that I have typed
over in a pivot? For example, if I had a column in my
source data call DEPT1 and I used that field as a row but
then type in a row header of DEPARTMENT instead of DEPT1.
How can I look at the pivot and know what data field I
used if I have typed over it. Hope that make sense.

Thanks for any help.
Ann
 
The following code will replace the pivot field and pivot item captions
with the data from the source table:

'===============================
Sub ResetFields()
Dim ws As Worksheet
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem

Application.ScreenUpdating = False
Set ws = ActiveSheet
Set pt = ws.PivotTables(1)

For Each pf In pt.PivotFields
pf.Caption = pf.SourceName
For Each pi In pf.PivotItems
pi.Caption = pi.SourceName
Next pi
Next pf
Application.ScreenUpdating = True

End Sub
'===================================
 
Actually, I was just looking for some option in the Pivot
table or options (field settings etc.) itself, not any
kind of coding.

But thanks for the response.
Ann
 
Back
Top