Checkbox to control Combobox ListSource?

thenapolitan

Board Regular
Joined
Sep 5, 2014
Messages
52
Hey All,

I am making a scoring sheet and new at learning VBA, so this might be a little out there, but I'm not sure if I can do it yet.

The userform I have has comboboxes where the user can select a team. When a team is selected, the player names are automatically chosen.

I would like to add a checkbox next to the combobox. I want the user to be able to click the checkbox if there is a substitute player, then view names from a different ListSource (where subs are stored) in the combobox.

Is this possible? See below for my userform - I haven't been able to find anything in my *googling* - any help would be great! Any questions, let me know!

Capture_zps923bdf3f.png




Thanks,

Chris
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You could use code like this
Code:
Private Sub CheckBox1_Click()
    If CheckBox1.Value Then
        ComboBox1.List = Range("otherRange").Value
    Else
        ComboBox1.List = Range("normalRange").Value
    End If
End Sub
 
Upvote 0
You could use code like this
Code:
Private Sub CheckBox1_Click()
    If CheckBox1.Value Then
        ComboBox1.List = Range("otherRange").Value
    Else
        ComboBox1.List = Range("normalRange").Value
    End If
End Sub

Excellent! Thanks mikerickson for helping out a newb! This is getting me exactly where I want to go :)
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top