szakharov7723
Board Regular
- Joined
- Jun 22, 2018
- Messages
- 85
- Office Version
- 2019
- Platform
- Windows
I am trying to apply data bar individually for every Field in PivotTable
Like this :
I was trying to create a code to start new datarange for every active field, but got stuck with this.
Unsurprisingly, it didn't work
Please help me to find the right code for this case
Like this :
I was trying to create a code to start new datarange for every active field, but got stuck with this.
VBA Code:
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Dim pfs As PivotFields
Set pfs = pt.PivotFields("Description")
For Each pi In pfs
pt.PivotFields("Sum of Defects").DataRange.Select
Next pi
Please help me to find the right code for this case