+ Reply to Thread
Results 1 to 12 of 12

Change Background color of a Form Button or ActiveX Button

  1. #1
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Change Background color of a Form Button or ActiveX Button

    Sorry in advance if im posting this in wrong area or this has been answered here already.

    I am very new to using Macro's and the Use of Controls. Im using Excell 2010

    What i am trying to do is Create a inventory form for my Job

    I have been able to create "Form button" and a "ActiveX Button" and assign a macro to that Button to send user to a specific Page within the workbook.

    Now what i am wanting if possible is once the user fills in all the fields the button that sent them there changes from Red to Green, if they only filled in some of the fields it will change to Yellow.

    Again please I am very new to all this and any help would be appreciated.

    Thank You

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Change Background color of a Form Button or ActiveX Button

    To the best of my knowledge you can't change the colour of a button. You can change the colour of the text on the button though. But why do you want to do this? Presumably the user can't see the button because you have taken them to a new page. so why do you want to change the button? It sounds like the real requirement is to give the user feedback that the form is not completed correctly. Is that right? If so, post a sample of the form so that someone can give you some advice on how to do that.

  3. #3
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Change Background color of a Form Button or ActiveX Button

    Thanks for the quick reply Mallycat,

    reason i want to change the Background color is so that once the user has filled in the fields and returns to the page were the button is they can tell they have filled in (None (red)), (Some (yellow)), or (All (green)) of the fields of said button.

    here are some screen shots of few pages of my inventory that should give you a better understanding.

    Attachment 149400
    Attachment 149401
    Attachment 149402
    Attachment 149403

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Change Background color of a Form Button or ActiveX Button

    Your attachments don't work. How about changing the text on the buttons to reflect the status. You can do that with code similar to this.

    Please Login or Register  to view this content.
    Just update the status something like Button 1 - Done, Button 1 - Not Done

    etc

  5. #5
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Change Background color of a Form Button or ActiveX Button

    Ok i have created another Workbook that has a 10th of the sheets the original has to give a better idea of what im attempting.

    I have put Text into each page as to what im attempting.

    The buttons that are there are all ActiveX Buttons that only have a basic Macro that sends them to a specific page in this workbook.

    Again Thank You for your Help

    Aeneren
    Attached Files Attached Files

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Change Background color of a Form Button or ActiveX Button

    Hi Aeneren. Try to insert this code into the 'Sheet1' module sheet.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Change Background color of a Form Button or ActiveX Button

    Thank You Nilem for responding,

    I think i have placed the code were you have sugested but i am not real positive not getting any color change to the Buttons. ive attached it as Inventory sample-1.

    Again sorry for my lack of knowledge on this and any more help you could give is appreciated.


    Aeneren
    Attached Files Attached Files

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Change Background color of a Form Button or ActiveX Button

    Oh, I was wrong. The code must be inserted in the module 'Inside 1' sheet (see attached file).
    You can assign roughly the same code on your buttons on the other tabs.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Change Background color of a Form Button or ActiveX Button

    Again nilem thank You for your Help.

    Ive tried to move your code and place it in other sheets to get the desired buttons to change color but i'm still needing your assistence if possible

    The code you created is working on the "Inside 1" Sheet But i really was trying to get the buttons on the:
    1. "Inside compartments" sheet to change there color when the Cells in the "Inside 1" "Inside 2" were updated
    2. And again the buttons on the "Outside Compartments" sheet to change when the "Outside 1" "Outside 2" were updated.
    3. then if possible to have the Buttons on the "Home Screen" change when the "Inside compartments" Button and "Outside Compartments" Buttons have changed


    Again sorry for my lack of knowledge with this and appreciate the help you have given


    Aeneren

  10. #10
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Change Background color of a Form Button or ActiveX Button

    Your task is executed
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Change Background color of a Form Button or ActiveX Button

    Wow Thank you so very much. I do bielieve you have nailed it.

    Many thanks to you

    Aeneren

  12. #12
    Registered User
    Join Date
    04-08-2012
    Location
    Kansas, U.S
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Change Background color of a Form Button or ActiveX Button

    Well little problem with few of the Codes not working as they should. But with some playing around i do bielieve they are all fixed now


    Again Thank You Nilem for getting me alot farther then what i would have on my Own


    Thanks
    Aeneren
    Last edited by Aeneren; 04-11-2012 at 05:53 PM. Reason: found couple Errors and reposting corrected Code

+ 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