Checkbox & List Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to set up a worksheet so that if a checkbox is checked, the list box is unlocked and if the check box is not selected, then users cannot touch the list box? I am not really good at VBA but any help would be greatly appreciated.
 
Hi,

Try this code.

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ListBox1.Enabled = True
Else
ListBox1.Enabled = False
End If
End Sub

jeff
-----Original Message-----
Is there any way to set up a worksheet so that if a
checkbox is checked, the list box is unlocked and if the
check box is not selected, then users cannot touch the
list box? I am not really good at VBA but any help would
be greatly appreciated.
 
Hi uftiffany

You can use something like this in the sheet module

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


--
Regards Ron de Bruin
http://www.rondebruin.nl


uftiffany said:
Is there any way to set up a worksheet so that if a checkbox is checked, the list box is unlocked and if the check box is not
selected, then users cannot touch the list box? I am not really good at VBA but any help would be greatly appreciated.
 
While in Design mode, right-click the check box and
select "View Code". Insert the following:

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

HTH
Jason
Atlanta, GA
-----Original Message-----
Is there any way to set up a worksheet so that if a
checkbox is checked, the list box is unlocked and if the
check box is not selected, then users cannot touch the
list box? I am not really good at VBA but any help would
be greatly appreciated.
 
See one more reply at your earlier post.
Thank you so much that was very helpful! Another quick question:

I am trying to get the items selected in the list box to feed into another cell. I have attempted using the LinkCell function in properties by typing the cell number in (ie: C75) but it still doesnt populate. Any ideas?
 

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

Back
Top