I have a PivotTable with values filtered by dates. Dates range from 01/01/2018 to 12/31/2019.
But I need to select only dates until the value of E4 cell (eg.: 03/29/2019).
It is not difficult to do manually, but I wanted to try using a macro to speed things up.
Recording the beginning of the macro, I got this:
But I don't know much about VBA, so I'm kind of lost.
Any help?
Best Regards
But I need to select only dates until the value of E4 cell (eg.: 03/29/2019).
It is not difficult to do manually, but I wanted to try using a macro to speed things up.
Recording the beginning of the macro, I got this:
Code:
Sub teste()
'
' teste Macro
'
'
ActiveSheet.PivotTables("Tabela dinâmica5").PivotFields("Data Arrumada"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("Tabela dinâmica5").PivotFields("Data Arrumada")
.PivotItems("4/27/2018").Visible = False
.PivotItems("6/29/2018").Visible = False
.PivotItems("7/13/2018").Visible = False
.PivotItems("7/27/2018").Visible = False
End With
End Sub
But I don't know much about VBA, so I'm kind of lost.
Any help?
Best Regards