oglezsa
04-06-2010, 10:20 AM
Hello,
Im trying to gray out the textbox labels in a userform when not selected, so far i have the textbox disable until the checkbox is selected but i want to make it easier for the user to identify what is enable or disable if or not selected...
Private Sub CheckBox9_Click()
If CheckBox9.Value = True Then
CheckBox8.Enabled = False
CheckBox8.Value = False
CheckBox7.Enabled = False
CheckBox7.Value = False
CheckBox6.Enabled = False
CheckBox6.Value = False
CheckBox5.Enabled = False
CheckBox5.Value = False
CheckBox4.Enabled = False
CheckBox4.Value = False
CheckBox3.Enabled = False
CheckBox3.Value = False
CheckBox2.Enabled = False
CheckBox2.Value = False
CheckBox1.Enabled = False
CheckBox1.Value = False
TextBox23.Enabled = False
TextBox24.Enabled = False
TextBox25.Enabled = False
TextBox26.Enabled = False
TextBox27.Enabled = False
TextBox28.Enabled = False
Else
CheckBox9.Enabled = True
CheckBox8.Enabled = True
CheckBox8.Value = False
CheckBox7.Enabled = True
CheckBox7.Value = False
CheckBox6.Enabled = True
CheckBox6.Value = False
CheckBox5.Enabled = True
CheckBox5.Value = False
CheckBox4.Enabled = True
CheckBox4.Value = False
CheckBox3.Enabled = True
CheckBox3.Value = False
CheckBox2.Enabled = True
CheckBox2.Value = False
CheckBox1.Enabled = True
CheckBox1.Value = False
End If
End Sub
Edit: VBA tags added to code
Im trying to gray out the textbox labels in a userform when not selected, so far i have the textbox disable until the checkbox is selected but i want to make it easier for the user to identify what is enable or disable if or not selected...
Private Sub CheckBox9_Click()
If CheckBox9.Value = True Then
CheckBox8.Enabled = False
CheckBox8.Value = False
CheckBox7.Enabled = False
CheckBox7.Value = False
CheckBox6.Enabled = False
CheckBox6.Value = False
CheckBox5.Enabled = False
CheckBox5.Value = False
CheckBox4.Enabled = False
CheckBox4.Value = False
CheckBox3.Enabled = False
CheckBox3.Value = False
CheckBox2.Enabled = False
CheckBox2.Value = False
CheckBox1.Enabled = False
CheckBox1.Value = False
TextBox23.Enabled = False
TextBox24.Enabled = False
TextBox25.Enabled = False
TextBox26.Enabled = False
TextBox27.Enabled = False
TextBox28.Enabled = False
Else
CheckBox9.Enabled = True
CheckBox8.Enabled = True
CheckBox8.Value = False
CheckBox7.Enabled = True
CheckBox7.Value = False
CheckBox6.Enabled = True
CheckBox6.Value = False
CheckBox5.Enabled = True
CheckBox5.Value = False
CheckBox4.Enabled = True
CheckBox4.Value = False
CheckBox3.Enabled = True
CheckBox3.Value = False
CheckBox2.Enabled = True
CheckBox2.Value = False
CheckBox1.Enabled = True
CheckBox1.Value = False
End If
End Sub
Edit: VBA tags added to code