Checkbox & List Box

U

uftiffany

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.
 
J

jeff

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.
 
R

Ron de Bruin

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.
 
J

Jason Morin

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.
 
D

Dave Peterson

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?
 
Top