Pivot Table PageField

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

Hey guys

I have a pivot table with 3 fields in the PageField. I
would like to just rearrange the position of the fields.
For instance Currently from top to bottom in the pagefield
I have field "AD", then "Supervisor", and
last "Department". I would simply like to alter their
position and put "Department" at the top, then "AD", and
last "Supervisor"

How do I do this?

Thank you.
 
If you mean by code, try recording a macro. That will give you the idea on
how to do that...
 
I did run a macro. The macros only show adding a field to
the pagefield. When I run a macro and rearrange the
fields, it does not show that.
 
Ok, try something like this then...

Sub Macro2()
With ActiveSheet.PivotTables("PivotTable1")
With .PivotFields("Field1")
.Orientation = xlColumnField
.Position = 1
End With

With .PivotFields("Field2")
.Orientation = xlRowField
.Position = 1
End With

With .PivotFields("Field3")
.Orientation = xlPageField
.Position = 1
End With
End With
End Sub


--
Regards,

Juan Pablo González

I did run a macro. The macros only show adding a field to
the pagefield. When I run a macro and rearrange the
fields, it does not show that.
 
Thanks that worked.

-----Original Message-----
Ok, try something like this then...

Sub Macro2()
With ActiveSheet.PivotTables("PivotTable1")
With .PivotFields("Field1")
.Orientation = xlColumnField
.Position = 1
End With

With .PivotFields("Field2")
.Orientation = xlRowField
.Position = 1
End With

With .PivotFields("Field3")
.Orientation = xlPageField
.Position = 1
End With
End With
End Sub


--
Regards,

Juan Pablo González

I did run a macro. The macros only show adding a field to
the pagefield. When I run a macro and rearrange the
fields, it does not show that.




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top