Pivot Table doesn't get new data

SandsB

Well-known Member
Joined
Feb 13, 2007
Messages
705
Office Version
  1. 365
Platform
  1. Windows
My report has a pivot table that gets data from a named range of 10,000 rows. My data never goes over 5,000 rows but I add to it every day until the end of the month. The pivot table is based on the date within the row and if I "select all" I still don't see the new data. I need to manually click on the new date before it's displayed. I'd prefer a solution that doesn't require Select All because that gives my chart based on the pivot table a Blank in the legend. Is there something I can do to my Pvot table so it'll update itself when new data appears or is there something I can add to a macro?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
"The pivot table is based on the date within the row and if I "select all" I still don't see the new data." This should say it doesn't add the new data if I use Select All as the default. I still have to pick the new date individually or deselect/reselect all manually.
 
Upvote 0
I don't know much about macro but I find the Record Macro in Excel a very helpful one!



VBA Code:
Sub ShowallExceptBlanks()

    With ActiveSheet.PivotTables("NameOfYourPivotTable").PivotFields("NameOfYourPivottableField")
        .ClearAllFilters
        .PivotItems("(blank)").Visible = False
    End With

End Sub
 
Last edited:
Upvote 0
I think Pivot needs refreshing the data every time an entry on the source is made. You can add RefreshAll code just before the 'With' Line on the above code.

VBA Code:
Sub ShowallExceptBlanks()

    RefreshAll
    With ActiveSheet.PivotTables("NameOfYourPivotTable").PivotFields("NameOfYourPivottableField")
        .ClearAllFilters
        .PivotItems("(blank)").Visible = False
    End With
End Sub
 
Upvote 0
If I understand you correctly, you need to right-click the relevant field, choose field settings, then check the 'include new items in manual filter' option.

I'd also suggest you use a table rather than a range that includes lots of blank rows.
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,099
Members
449,096
Latest member
provoking

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top