ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Color of Buttons (https://www.excelbanter.com/excel-programming/402061-color-buttons.html)

TotallyConfused

Color of Buttons
 
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.

excelent

Color of Buttons
 
In Properties Back color

"TotallyConfused" skrev:

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.


JLGWhiz

Color of Buttons
 
If the button is from the Control Toolbox, you can change the color by
opening the properties menu and using the Backcolor for the button face color
and Forecolor for the caption color.

"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.


OssieMac

Color of Buttons
 
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.



All times are GMT +1. The time now is 04:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com