VBA , How do I grey out a Checkbox and a Combobox to limit User's Input

New_Alex
New_Alex used Ask the Experts™
on
Private Sub CheckBox1_Click()

End Sub

Private Sub CheckBox2_Click()

End Sub

Private Sub CheckBox3_Click()

End Sub

Private Sub ComboBox1_AfterUpdate()

End Sub

Open in new window


I have 3 CheckBoxes and One ComboBox .

I would like when I click on CheckBox1 to GreyOut Checkbox3 and ComboBox1
When I click on CheckBox2 to Remove all of the above Greyed limitations.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Private Sub CheckBox1_Click()
  CheckBox1 .Enable = false
  CheckBox3 .Enable = false
End Sub

Private Sub CheckBox2_Click()
 CheckBox1 .Enable = true
 CheckBox3 .Enable = true
End Sub
Commented:
Try this...

Private Sub CheckBox1_Click()

  If Checkbox1.Value = True Then
        Checkbox3.enabled = false
        ComboBox1.enabled = false
    End If

End Sub

Private Sub CheckBox2_Click()
  If Checkbox2.Value = True Then
        Checkbox3.enabled = true
        ComboBox1.enabled = true
    End If
End Sub

Private Sub CheckBox3_Click()

End Sub

Private Sub ComboBox1_AfterUpdate()

End Sub
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
  CheckBox3.Enabled = False
  ComboBox1.Enabled = False
End If
End Sub

Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then
  CheckBox3.Enabled = True
  ComboBox1.Enabled = True
End If
End Sub

You can remove the If statement if u don't care whether the checkbox is checked or not.

Author

Commented:
Thank you guys

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial