+ Reply to Thread
Results 1 to 3 of 3

User form Change button color

  1. #1
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    User form Change button color

    Im looking for a simple way to just change background color of a userform from the button being clicked it would change the color from gray to green when clicked, then when clicked again back to gray....
    there are a bunch of button and I was hoping not to have to code them all.

    Thank you for your help

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: User form Change button color

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: User form Change button color

    Hi there,

    I'm not sure what your Buttons do, but you can't change the color of a Form Control Button. You can however change the color of an ActiveX control Button. And if you don't want to code for each button, you will have to use a Class Module.

    Step One is to get rid of your Buttons and Replace them with CommandButtons. Then Insert a Class Module. Name the Class Module Buttons3 and paste the code below into the Class Module.

    Please Login or Register  to view this content.
    Then in a General Module, Paste This Code:
    Please Login or Register  to view this content.
    Run Class_Init and click your CommandButtons.

    You can Call Class_Init from Workbook_Open if you'd like.

    As a note, I didn't see what your buttons do as I'd mentioned above, but their function should be carried out in the Class Module.

    Additionally, in the interest of honesty, I found the basis of this code on this forum some time ago, and for the life of me, I can't find it again to give credit to the author... But it works great!

    Thanks!
    Last edited by Raymundus; 01-25-2016 at 12:26 PM.

+ 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. Change the text color of a form button in Excel Mac 2011?!
    By RiTz21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2014, 06:25 PM
  2. VBA User Form to change the Colour of a number of cells using a Button
    By Nathan44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2013, 12:10 PM
  3. [SOLVED] User Form - Hyperlink Button within a Form, to create a Link on a Designated Cell
    By Sinalk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 07:29 AM
  4. [SOLVED] Change Background color of a Form Button or ActiveX Button
    By Aeneren in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-11-2012, 12:19 PM
  5. VBA User Form - Linking Close Button and Cancel Button
    By nivassrii in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2011, 07:05 AM
  6. Form - allow user to change font color
    By ker9 in forum Word Formatting & General
    Replies: 0
    Last Post: 02-02-2011, 12:56 PM
  7. Filling form fields via worksheet dropdowns, user update via form, change form color
    By Demosthenes&Locke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2010, 08:58 AM
  8. Change list box color in user form
    By knarf in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-20-2009, 07:20 AM

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