FrancescoAFR
New Member
- Joined
- Aug 5, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hi everyone,
I have a problem with this code:
To try and identify the problem, I checked through the Locals to ensure the pivot table is assigned correctly and I also tried using a
before setting pf, but the error message remains the same:
"Unable to get the PivotFields property of the PivotTable class"
Thanks
I have a problem with this code:
VBA Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim ws As Worksheet
Dim pv As PivotTable
Dim pf As PivotField
Set ws = ThisWorkbook.Worksheets("Atleti e Media")
Set pv = ws.PivotTables("PerATleta")
Set pf = pv.PivotFields("Media Ore Settimanale")
For Each pf In pv.PivotFields
pf.ClearAllFilters
pf.PivotItems("00:00:00").Visible = False
End Sub
To try and identify the problem, I checked through the Locals to ensure the pivot table is assigned correctly and I also tried using a
VBA Code:
For Each pf In pv.PivotFields
"Unable to get the PivotFields property of the PivotTable class"
Thanks