findingcindy
New Member
- Joined
- Apr 3, 2025
- Messages
- 7
- Office Version
- 2013
- Platform
- Windows
Good morning! I have the code below that changes the value on my pivot table on another sheet but it does not refresh the pivot table, therefore my pivot chart doesn't refresh. Any help would be greatly appreciated.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim PT As PivotTable
Dim Field As PivotField
Dim NewCat As String
Set PT = Worksheets("Chart").PivotTables("PivotTable6")
Set Field = PT.PivotFields("Filter")
NewCat = Worksheets("Scorecard").Range("b4").Value
ActiveSheet.PivotTables("PivotTable6").PivotCache.Refresh
End Sub