Filtering pivot table with vba
I have a chart that picks the info from a pivot table that I have with daily data. I am trying to create activeX buttons so it can filter the data which is as ROW LABEL, to see how my data behaved in the last week and in the last month So, what I have until now and it is not working is: Private Sub weekbtn1_Click() Dim i As Integer If weekbtn1 = True Then i = 0 Do Until Datavalue(date) - i = 42005 With ActiveSheet.PivotTables("Pivotcompsprice").PivotFields("Date") .PivotItems DateValue(Date) - i.Visible = False i = i + 1 End With Loop i = 0 Do Until i = 7 With ActiveSheet.PivotTables(