+ Reply to Thread
Results 1 to 7 of 7

Multiple conditional shapes

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    tilburg
    MS-Off Ver
    Excel 2010
    Posts
    4

    Multiple conditional shapes

    Hi, Im making a performance dashboard with 16 shapes which color red/yellow/green depending on numbers in a table. Now I managed to do one shape(the red one) and it woks like a charm, but what is the best way, or even a way, to also do the rest?

    Thanks for helping!

    Test dashboard.xlsm

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Multiple conditional shapes

    Hi daafje,

    I'm running 2003, so I can't test this - but it recognizes "Afwijkingen" this way!

    Your code with my additions is followed by my subroutines for those additions - let me know if it worked!


    Please Login or Register  to view this content.
    (You may need to run the "Degroup" several times)
    Last edited by xladept; 01-17-2013 at 05:24 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Multiple conditional shapes

    To get a single set of commands to address multiple shapes, it's easiest to put the names of the shapes adjacent to the values that control them. I added them to column E.

    Then your Worksheet_Change event becomes:
    Please Login or Register  to view this content.
    And the only macro needed then does the work:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JBeaucaire; 01-17-2013 at 05:28 PM. Reason: Added comments to code
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    12-21-2012
    Location
    tilburg
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Multiple conditional shapes

    Wow both of you, thanks so much! You saved me days work! Dont fully understand the code yet, but ill get there. Very happy.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Multiple conditional shapes

    I've added comments to my code above to assist.

    If that takes care of your original query, please select Thread Tools from the menu above and mark the thread as solved. Thanks.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Multiple conditional shapes

    You're welcome!

  7. #7
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Multiple conditional shapes

    daafje

    Another variation on the them since I worked on this also

    Change any value on col D

    Test dashboard v2.xlsm
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

+ 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