Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I see that you have answers to actually set the color in properties but you
also asked 'a way to highlight the button when using it'. The following code will toggle the background color of the button between red and yellow each time it is clicked. Private Sub CommandButton1_Click() If Me.CommandButton1.BackColor = &HFF& Then 'Red Me.CommandButton1.BackColor = &HFFFF& 'Yellow Else Me.CommandButton1.BackColor = &HFF& 'Red End If End Sub The codes for the color can be obtained from the properties dialog box. When you select the Palet tab for the color and change the color, you will see the code appear on the line. If you enter the entire number in VBA with the leading zeros after the H (Hex) then VBA removes them. -- Regards, OssieMac "TotallyConfused" wrote: Is there any way you can change the color of buttons on a User Form in Excel? or a way to highlight the button when using it? If so how? I can't find anything on how to do this. Can someone please help? Thank you in advance for any help you can provide. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COMMAND BUTTONS and CELL COLOR | Excel Discussion (Misc queries) | |||
Multiple fill color buttons | Excel Discussion (Misc queries) | |||
changing the color of the buttons | Excel Discussion (Misc queries) | |||
Font color buttons? | Excel Programming | |||
How to change color of buttons if pressed? | Excel Programming |