Format Page Field

  • Thread starter Thread starter TheVisionThing
  • Start date Start date
T

TheVisionThing

I'm looking for some code as follows to change the background color of every
page field in a pivot table

Dim pt as PivotTable,pf as PivotField
For Each ws In ThisWorkbook.Worksheets
For Each pf In pt.PageFields
' change the background color
Next
Next

Thanks,
Wayne C.
 
Maybe...


Dim pt As PivotTable
Dim pf As PivotField
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
For Each pt In ws.PivotTables
For Each pf In pt.PageFields
pf.LabelRange.Interior.ColorIndex = 6
Next pf
Next pt
Next ws
 

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