+ Reply to Thread
Results 1 to 2 of 2

Excel Pivot Table VB Code

  1. #1
    carolini
    Guest

    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. #2
    Jonathan Cooper
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1