ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checkbox - Change color of label when clicked (https://www.excelbanter.com/excel-programming/384718-checkbox-change-color-label-when-clicked.html)

Tammy H

Checkbox - Change color of label when clicked
 
Is there a way to change the background color of a checkbox label when it is
checked and change it back to white if it is un-checked?

Keith74

Checkbox - Change color of label when clicked
 
Hi

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
CheckBox1.BackColor = RGB(0, 255, 0)
Else
CheckBox1.BackColor = RGB(255, 255, 255)
End If

End Sub

hth


Tammy H

Checkbox - Change color of label when clicked
 
Thanks Keith! Works great.

"Keith74" wrote:

Hi

Private Sub CheckBox1_Change()
If CheckBox1.Value = True Then
CheckBox1.BackColor = RGB(0, 255, 0)
Else
CheckBox1.BackColor = RGB(255, 255, 255)
End If

End Sub

hth




All times are GMT +1. The time now is 05:33 PM.

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