Results 1 to 3 of 3

Button Color

This is a discussion on Button Color within the Excel Questions forums, part of the Question Forums category; I have a userform that I created. Is there a way to change the color once the button has been ...

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Nashua NH
    Posts
    164

    Default

    I have a userform that I created. Is there a way to change the color once the button has been clicked?

    I'm sure if I had a checkbox, which has true and false, I could change from one color to another depending on the status of checked or not.

    However, with the command button, I'm not sure. If I clicked it once, it would most likely stay the new color.

    Example:

    Commandbutton1 'Standard gray

    Commandbutton_click
    'changes to blue.

    This way, the user would know if that function had been performed.

    G

  2. #2
    Board Regular
    Join Date
    May 2002
    Location
    Toronto
    Posts
    209

    Default

    Try this

    Private Sub CommandButton1_Click()
    CommandButton1.BackColor = &HFF8080
    End Sub

    HTH,
    Regards, Tom

  3. #3
    MrExcel MVP lenze's Avatar
    Join Date
    Feb 2002
    Location
    Helena, MT
    Posts
    13,690

    Default

    Depending on your application, it might also be possible for you to use a ToggleButton instead of a Command button. The ToggleButton has a Value property of TRUE FALSE

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com