Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just out of curiosity, why the CBool?
Force of habit. In VB6, the Value property of a CheckBox returns an Integer, not a Boolean. I like to do the conversion to boolean myself -- self-documenting code and all that. Just in case the TripleState property of the CheckBox is True, the better code would be as follows: Private Sub CheckBox1_Click() With Me.TextBox1 If IsNull(Me.CheckBox1.Value) Then .Enabled = False ' or True, as desired Else .Enabled = Me.CheckBox1.Value End If End With End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... Hi Chip: Just out of curiosity, why the CBool? Regards, Vasant. "Chip Pearson" wrote in message ... Todd, Try something like the following in the user form's code module: Private Sub CheckBox1_Click() Me.TextBox1.Enabled = CBool(Me.CheckBox1.Value) End Sub "Todd uttenstine" wrote in message ... I have CheckBox1 and TextBox1 on a UserForm. What is the code that would enable entry into TextBox1 if CheckBox1 has a check in it? Thank you Todd Huttenstine |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checkbox and conditional formating | Excel Discussion (Misc queries) | |||
Enabling voting button | Excel Discussion (Misc queries) | |||
Shrinking Checkbox and Radio Button | Excel Discussion (Misc queries) | |||
using a checkbox for a conditional function | Excel Worksheet Functions | |||
Help with function to add percentage to cell based on checkbox. | Excel Worksheet Functions |