View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Heera Heera is offline
external usenet poster
 
Posts: 98
Default 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