Forum Discussion
Pivot Table Refresh Not Working
- Aug 01, 2022
Thanks, I received your PM.
Your pivot table is filtered to display only data for HDL File Name = Contact.dat.
I disabled the Worksheet_Change event procedure, then deleted one of the Contact.dat rows.
Refreshing the pivot table from the PivotTable Analyze tab of the ribbon worked as expected.
I also added a new row to the source table with HDL File Name = Contact.dat. Again, refreshing the pivot table from the ribbon worked correctly.
Is it possible that you added/deleted rows for other HDL File Names? The pivot table wouldn't change as long as it is filtered on Contact.dat
Could you attach a sample workbook (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Thanks in advance.
- learnerjaneAug 01, 2022Copper Contributor
I have shared the OneDrive link over DM.
For now I have fixed it with a VBA code.
Below Subs didn't work, not sure why, and the manual refresh also:
Sub RefreshOneTable ActiveSheet.PivotTables("PivotTable1").RefreshTable End SubSub RefreshActiveSheetPivotsOnly() Dim tblPivot As PivotTable For Each tblPivot In ActiveSheet.PivotTables tblPivot.RefreshTable Next tblPivot End Sub
Working Code:Private Sub Worksheet_Change(ByVal Target As Range) ThisWorkbook.RefreshAll End Sub- HansVogelaarAug 01, 2022MVP
Thanks, I received your PM.
Your pivot table is filtered to display only data for HDL File Name = Contact.dat.
I disabled the Worksheet_Change event procedure, then deleted one of the Contact.dat rows.
Refreshing the pivot table from the PivotTable Analyze tab of the ribbon worked as expected.
I also added a new row to the source table with HDL File Name = Contact.dat. Again, refreshing the pivot table from the ribbon worked correctly.
Is it possible that you added/deleted rows for other HDL File Names? The pivot table wouldn't change as long as it is filtered on Contact.dat
- learnerjaneAug 01, 2022Copper ContributorMy bad. I totally missed it. Thanks Hans.