Setting a CheckBox Value to False

G

Guest

Hi: I'd like to set a checkbox value to false after selection of an item
from a Combo Box. I've tried various things, but cannot seem to get the
correct syntax. Both the Combo Box and Check Box are on a User Form. The
latest code tried is:

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) > 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True: Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Any help will be appreciated...
 
G

Guest

Folks: I figured it out. Here's the final code:
Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) > 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True
CheckBox1.Value = Cells(cmbMembers.Value, 4)
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub

Thanks...
 
T

Tom Ogilvy

Private Sub cmbMembers_Change()
If Val(cmbMembers.Value) > 0 Then
Cells(cmbMembers.Value, 1).Select
CheckBox1.Enabled = True
CheckBox1.Value = False
Else
CheckBox1.Enabled = False
CheckBox2.Enabled = False
CheckBox3.Enabled = False
End If
End Sub
 
T

theguz

Or:

'I am assuming the name of the form is UserForm1

UserForm1.Controls("CheckBox1").Value = False

Hope this helps

theguz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top