VBA Code For Pivot Table.

H

Heera

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
 
B

Barb Reinhardt

I've done something similar and decided to put a helper column in to identify
the data I want to use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top