[Solved] Filter date to update pivot table daily [closed]


I can’t help myself…

Base Data Used:

Base Data Example

Pivot Table Layout:

Pivot Table
Pivot Table Setting

Code Used:


' *** On Workbook Module ***
Option Explicit
Private Sub Workbook_Open()
    Call UpdatePivotTableDateToYesterday
End Sub

' *** In Module 1 ***
Option Explicit
Sub UpdatePivotTableDateToYesterday()
    Sheet5.PivotTables("PivotTable4").PivotFields("Date").ClearAllFilters
    Sheet5.PivotTables("PivotTable4").PivotFields("Date").CurrentPage = Format(Date - 1, "m/d/yyyy")
End Sub

2

solved Filter date to update pivot table daily [closed]