Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
carolini
 
Posts: n/a
Default Excel Pivot Table VB Code

Hi,

I currently have a Pivot Table report that shows data in rolling 12 months
(12/2004 to 11/2005). Once I refresh the data I get 13 months (12/2004 to
12/2005)and then I go into each pivot and click off the earliest month
(12/2004).

Can anyone help me with a code that would click off the earliest month?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jonathan Cooper
 
Posts: n/a
Default Excel Pivot Table VB Code

assuming your dates are NOT entered as text, and that youyou could insert a
helper column with the following formula.

=IF(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0)-DATE(YEAR(A4),MONTH(A4)+1,0)<365,"show","hide")

A4 is the cell in your data table, that contains the date you are using. I
did it this way because I wasn't sure if you were consistently using month
end dates or not.

Now, add this helper column to your pivot table, and then use this field as
your page feild.

"carolini" wrote:

Hi,

I currently have a Pivot Table report that shows data in rolling 12 months
(12/2004 to 11/2005). Once I refresh the data I get 13 months (12/2004 to
12/2005)and then I go into each pivot and click off the earliest month
(12/2004).

Can anyone help me with a code that would click off the earliest month?

Thanks!

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 - Multiple consolidation Range tengreen Excel Worksheet Functions 1 July 1st 05 07:18 PM
Problems with Pivot Table Field Sorting in Excel 2002 Phoenix71555 Excel Discussion (Misc queries) 1 February 27th 05 11:25 PM
Can't group pivot table items by month in Excel scott_ensley Excel Discussion (Misc queries) 1 February 1st 05 08:41 PM
convert excel list to pivot table GI Excel Discussion (Misc queries) 0 December 6th 04 06:45 PM
Referring to Pivot Table in Excel 2003 Martin_xx Excel Worksheet Functions 1 November 2nd 04 09:45 PM


All times are GMT +1. The time now is 03:34 AM.

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"