+ Reply to Thread
Results 1 to 3 of 3

Loop Through Variable Number of Pivot Table Series to change properties

  1. #1
    Registered User
    Join Date
    05-15-2020
    Location
    Delaware, USA
    MS-Off Ver
    2013
    Posts
    2

    Loop Through Variable Number of Pivot Table Series to change properties

    I'm new to loops and am looking for a way to loop through pivot table series to change their colors. I am able to do it statically with the following code:
    Please Login or Register  to view this content.
    In this example I am changing series 1 to Brown, series 2 to blue, series 3 to green, and series 4 to orange. I need this pattern to repeat every 4 series. But it needs to be dynamic since the number of series will change each time. There could be 12 series, 20, 24, etc..

    Any help is appreciated!

    Thanks!
    Last edited by alansidman; 05-15-2020 at 04:12 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,858

    Re: Loop Through Variable Number of Pivot Table Series to change properties

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-15-2020
    Location
    Delaware, USA
    MS-Off Ver
    2013
    Posts
    2

    Re: Loop Through Variable Number of Pivot Table Series to change properties

    I think I have found half the answer. I can loop through using the following change to the code. The only thing I need to do now is define "ListCount" as an integer. The way I'd like to find this variable is by searching through a column in my raw data table for the # of unique values. I've tried many different options I've found with no success. Can anyone provide help? I need the unique value search to be in only 1 column, but the column will have a variable # of rows.


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change properties of multiple activex buttons in 3 columns with a loop and an array
    By boardy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-27-2020, 06:31 PM
  2. [SOLVED] Use a variable to change pivot table filter
    By dweingar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-18-2019, 12:14 PM
  3. Change Chart Pivot series Colour depending from Pivot Table Filter value
    By BrianAll in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2018, 02:20 PM
  4. Use a variable name for the pivot table to change format
    By noboffinme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2018, 04:16 AM
  5. Change Number Format in a Pivot Table
    By TestMailinator in forum Excel General
    Replies: 4
    Last Post: 05-29-2015, 10:00 AM
  6. Replies: 6
    Last Post: 02-19-2009, 07:57 AM
  7. Change Variable data on 1 pivot table, make same changes in other pivot tables
    By matt4003 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2008, 10:55 PM

Tags for this Thread

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