+ Reply to Thread
Results 1 to 8 of 8

Pivot Tables

  1. #1
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Pivot Tables

    I have multiple charts that collect data from multiple pivot tables. The tables contain a BUDGET column with data for 12 months and an ACTUAL column with data for the number of months in the year to date. I have created a userform with a drop-down list from which the user is prompted to select the current month. Based on the selection, I want to display the months in each table from January to May this month and next month it will be from January to June. I am having difficulty creating the For each Next loop which must select the correct number of month in each table based on the month selected from the drop-down list. Please help.
    Thank you in advance
    Attached Files Attached Files
    Last edited by Aland2929; 06-12-2010 at 08:15 AM.

  2. #2
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Pivot Tables

    Quote Originally Posted by Aland2929 View Post
    I have multiple charts that collect data from multiple pivot tables. The tables contain a BUDGET column with data for 12 months and an ACTUAL column with data for the number of months in the year to date. I have created a userform with a drop-down list from which the user is prompted to select the current month. Based on the selection, I want to display the months in each table from January to May this month and next month it will be from January to June. I am having difficulty creating the For each Next loop which must select the correct number of month in each table based on the month selected from the drop-down list. Please help.
    Thank you in advance
    I have attached the file with the code that selects the months for the first table. I need help in writing code so that all the tables are adjusted according to the month selected.
    Attached Files Attached Files

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Pivot Tables

    Perhaps:

    Please Login or Register  to view this content.
    (you might need to be careful in the positioning of your Pivots so as to ensure when they get to Dec as they do not overlap)

  4. #4
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Smile Re: Pivot Tables

    Quote Originally Posted by DonkeyOte View Post
    Perhaps:

    Please Login or Register  to view this content.
    (you might need to be careful in the positioning of your Pivots so as to ensure when they get to Dec as they do not overlap)
    Thank you so much DonkeyOte. It works perfectly. I had spaced the pivot tables to take account of the extra months as the pivot tables expand. I will now have to work through your code to understand it, but this is the way to learn. Once again, thanks for your time and effort.

  5. #5
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Re: Pivot Tables

    Quote Originally Posted by Aland2929 View Post
    Thank you so much DonkeyOte. It works perfectly. I had spaced the pivot tables to take account of the extra months as the pivot tables expand. I will now have to work through your code to understand it, but this is the way to learn. Once again, thanks for your time and effort.
    I copied the code to my "real" file and it did not work? I stepped through the code and it seems to have a problem at the line:
    Please Login or Register  to view this content.
    Can you suggest where I can check for a solution?

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Pivot Tables

    When you say "did not work" I presume you mean that the Pivots did not update as expected ?

    I say that based on the fact that the original code had an Error handler in place so it should not debug per se.

    The code expects Pivot Item values in the form of "January","February" etc...

    In reality I suspect we will need to see the file or at least a small version of it (dummy anything confidential).

  7. #7
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Smile Re: Pivot Tables

    Quote Originally Posted by DonkeyOte View Post
    When you say "did not work" I presume you mean that the Pivots did not update as expected ?

    I say that based on the fact that the original code had an Error handler in place so it should not debug per se.

    The code expects Pivot Item values in the form of "January","February" etc...

    In reality I suspect we will need to see the file or at least a small version of it (dummy anything confidential).
    Yes, the pivots did not update. I am going to try solve this but will post again if I am not succesful. Once again, thanks.

  8. #8
    Forum Contributor
    Join Date
    06-11-2009
    Location
    Cape Town
    MS-Off Ver
    Microsoft 365
    Posts
    854

    Smile Re: Pivot Tables

    Quote Originally Posted by Aland2929 View Post
    Yes, the pivots did not update. I am going to try solve this but will post again if I am not succesful. Once again, thanks.
    Thanks for the direction DonkeyOte. The problem was the format of the dates in my "real" file. My pivot sheet had "Jan, Feb, Mar" etc. I changed the code to:
    Please Login or Register  to view this content.
    It now works perfectly.
    Thanks for all your help.

+ 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