ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   remove rows from Pivot Table (https://www.excelbanter.com/excel-programming/388949-remove-rows-pivot-table.html)

Steve

remove rows from Pivot Table
 
I have created a Pivot Table with multiple rows of data for each date.
However, I would like to automate so that only the last 2 days of data is
visible. I am able to get the last 2 days showing but can't seem to automate
removing all the rest of the dates.

vD = FormatDateTime(Now() , 2)
vD1 = FormatDateTime(Now() - 1, 2)

With ActiveSheet.PivotTables("PivotTable2").PivotFields ("Day")
.PivotItems(vD).Visible = True
.PivotItems(vD1).Visible = True
End With


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com