Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table - Multiple consolidation Range | Excel Worksheet Functions | |||
Problems with Pivot Table Field Sorting in Excel 2002 | Excel Discussion (Misc queries) | |||
Can't group pivot table items by month in Excel | Excel Discussion (Misc queries) | |||
convert excel list to pivot table | Excel Discussion (Misc queries) | |||
Referring to Pivot Table in Excel 2003 | Excel Worksheet Functions |