ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pivot Items Filter using VBA (https://www.excelbanter.com/excel-discussion-misc-queries/446359-pivot-items-filter-using-vba.html)

Gaura215

Pivot Items Filter using VBA
 
Hello

I have a code which make a Pivot using VBA. however there is a condition that I am unable to fulfilled in that pivot using my VBA.

I will try to write it here the code I wish for.

ActiveSheet.PivotTables("PivotTable2").PivotFields _ ("ReportTimeframe") .CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivotTable2").PivotFields ("Report Timeframe")
.PivotItems.Last Month.Visible = True
.PivotItems.All Other Months.Visible = False

End With

I want a fix in my underline codes above.

Any help in this would be appreciable.


All times are GMT +1. The time now is 07:36 AM.

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