Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I change the forecolor of a CheckBox when True
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I change the forecolor of a CheckBox when True
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: |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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: |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I change the forecolor of a CheckBox when True
With cbxgroup.parent.oleobjects("cbxfee" & whichone)
.printobject = cbxgroup.value with .object If .Value = True Then .ForeColor = RGB(255, 0, 0) ' Red Else .ForeColor = RGB(0, 0, 255) End If end with End With (Untested, uncompiled. Watch for typos.) PJ Murph wrote: 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: -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change Excel Cell forecolor using VB6 | Excel Discussion (Misc queries) | |||
For...Loop to verify at least one checkbox = True | Excel Programming | |||
change forecolor with code | Excel Discussion (Misc queries) | |||
If one checkbox = true | Excel Discussion (Misc queries) | |||
checkbox true/false label | Excel Programming |