Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

Checkboxes

Posted by Mary on December 03, 2001 8:06 AM
Is there anyway I can change the colour of the text or background for a check box if it is selected.

I use a worksheet to pre-select the value of a series of checkboxes on a userform. I want to highlight the current selections more forcefully than the simple tick

Thanks for any help given

Mary


Re: Checkboxes

Posted by Tom Dickinson on December 03, 2001 9:42 AM
Try this:

Private Sub CheckBox1_Click()
If CheckBox1 Then
CheckBox1.BackColor = &H80FF&
Else
CheckBox1.BackColor = &HFFFFFF
End If
End Sub

The first turns it to rust, the else changes it to white. For other color selections, find the color you want in the background properties, and copy it to the macro.


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.