Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code For Pivot Table.
Hi,
I am doing a report and the user will have an option to select the start date from which they want the data. After creating a pivot table i want to exclude the dates which are not required. For example i have data starting from 1-Apr-2008 and the user wants the report from 5-Apr2008. Here is the code which will remove the non required dates but this code will remove only those dates which are mentioned in the code but the user can select any date after 1-Apr-2008. With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Audit Date") .PivotItems("1-Apr-08").Visible = False .PivotItems("2-Apr-08").Visible = False .PivotItems("3-Apr-08").Visible = False .PivotItems("4-Apr-08").Visible = False End with Can any one help me with the code which will remove the non required dates till the start point. Regards Heera |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code For Pivot Table.
I've done something similar and decided to put a helper column in to identify
the data I want to use. -- HTH, Barb Reinhardt "Heera" wrote: Hi, I am doing a report and the user will have an option to select the start date from which they want the data. After creating a pivot table i want to exclude the dates which are not required. For example i have data starting from 1-Apr-2008 and the user wants the report from 5-Apr2008. Here is the code which will remove the non required dates but this code will remove only those dates which are mentioned in the code but the user can select any date after 1-Apr-2008. With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Audit Date") .PivotItems("1-Apr-08").Visible = False .PivotItems("2-Apr-08").Visible = False .PivotItems("3-Apr-08").Visible = False .PivotItems("4-Apr-08").Visible = False End with Can any one help me with the code which will remove the non required dates till the start point. Regards Heera |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Code - Simple Code Fix? | Excel Programming | |||
Code that will rerun or refresh a pivot table (after new data ispasted into the original Pivot Table's Source Range) | Excel Programming | |||
Code for a Macro that allows a Pivot table to be repeatedly run (fora dynamic rows in a table, but static field names) | Excel Programming | |||
Pivot Table Code | Excel Discussion (Misc queries) | |||
VBA Code for a pivot table to open database and to reference table current page | Excel Programming |