+ Reply to Thread
Results 1 to 5 of 5

Code to change button

  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    50

    Code to change button

    I got the following code from "Wotadude" and I'm looking to add a little more to it. It current makes a button switch back and forth from saying "red" or "white". I want to add two more colors ("Blue" and "Green") and have the button rotate between the 4 colors as you continue to click it. I need a little assistance with the code.
    Thanks for looking/your help.


    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Code to change button

    This code should do it, but you didn't post your file for me to test it. Note that in your original code, the comments "red fill" and "red font" are wrong.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-14-2012
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Code to change button

    6 String,
    Thanks for your help. The code isn't making the button switch. I have now attached an example with both codes programmed to each button on the spreadsheet. If you could help me figure out why that code isn't working, that would be great.
    Thanks again!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-14-2012
    Location
    Ames, Iowa
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Code to change button

    Nevermind - I figured out that I need to start the button name "RED" for it to work. I have it going like I need it to now. Thanks again!

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Code to change button

    I removed the Else case as unnecessary but maybe it's necessary. If the button starts out being none of the four colors, it should be the same as the RED case then the starting state won't matter.

    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)

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