View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
PJ Murph[_2_] PJ Murph[_2_] is offline
external usenet poster
 
Posts: 19
Default How do I change the forecolor of a CheckBox when True

How do I adapt your code into this?
'Public WithEvents CBXGroup As MSForms.CheckBox
Private Sub CBXGroup_Change()'
WhichOne = Mid(CBXGroup.Name, Len("cbxFee") + 1)
With CBXGroup.Parent.OLEObjects("cbxFee" & WhichOne)
.PrintObject = CBXGroup.Value
End With

"Chip Pearson" wrote:

Try code like the following:


Private Sub CheckBox1_Click()
With Me.CheckBox1
If .Value < 0 Then
' checked
.ForeColor = RGB(255, 0, 0) ' Red
Else
' unchecked
.ForeColor = RGB(0, 0, 255) ' Blue
End If
End With
End Sub


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)





On Fri, 10 Apr 2009 13:24:03 -0700, PJ Murph
wrote: