Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Code - Simple Code Fix? J.W. Aldridge Excel Programming 2 April 4th 08 02:24 PM
Code that will rerun or refresh a pivot table (after new data ispasted into the original Pivot Table's Source Range) Mike C[_5_] Excel Programming 3 February 15th 08 06:22 AM
Code for a Macro that allows a Pivot table to be repeatedly run (fora dynamic rows in a table, but static field names) Mike C[_5_] Excel Programming 1 February 11th 08 04:30 AM
Pivot Table Code FA Excel Discussion (Misc queries) 6 October 11th 05 04:03 PM
VBA Code for a pivot table to open database and to reference table current page Pete Straman Straman via OfficeKB.com Excel Programming 0 February 21st 05 03:57 AM


All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"