• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Populating ComboBox based on Option button in excel userform

Hello
In an excel userform i have 3 option buttons
If i choose optionbutton 1 a combobox must be filled with range
Something like that
Code:
 ComboBox1.RowSource = Sheets("artikellijst").Range("K3:K9").Value
If i choose optionbutton 2 a combobox must be filled with range
Code:
 ComboBox1.RowSource = Sheets("artikellijst").Range("K10:K128").Value
If i choose optionbutton 3 a combobox must be filled with range
Code:
 ComboBox1.RowSource = Sheets("artikellijst").Range("K129:K184").Value
Any help welcome
Thanks
 
Example event code for Optionbutton1 would be:
Code:
Private Sub OptionButton1_Click()
With Me
    .OptionButton2.Value = 0
    .OptionButton3.Value = 0
    .ComboBox1.RowSource = "Sheet1!A1:A5"
End With
End Sub
 
Hello,
Thank you for your quick response
I have this now
Code:
Private Sub OptionButton1_Click()
With Me
  .OptionButton2.Value = 0
  .OptionButton3.Value = 0
  .ComboBox1.RowSource = "artikellijst!K3:K9"
End With
End Sub
But is does not populate the ComboBox
 
Hello,
I solved it with this
Code:
Private Sub OptionButton1_Click()
ListBox1.List = Worksheets("artikellijst").Range("A3:G11").Value
End Sub
it works with a combobox to
thanks for the help
 
Back
Top