Populate a combobox without using a userform
trésorix
-
Gyrus Posted messages 3360 Status Member -
Gyrus Posted messages 3360 Status Member -
Hello,
so here it is, I would like to populate my combobox using a range of cells, the problem is that I've noticed that on most forums a userform appears at the top of the code while I simply do not see one: here is what I have:
Private Sub ComboBox2_Change()
ComboBox2.RowSource = Array("Nbrjour").Value
End Sub
why am I not able to get my values in my combobox? Anyone? pleaaas?
Configuration: Windows / Chrome 53.0.2785.143
so here it is, I would like to populate my combobox using a range of cells, the problem is that I've noticed that on most forums a userform appears at the top of the code while I simply do not see one: here is what I have:
Private Sub ComboBox2_Change()
ComboBox2.RowSource = Array("Nbrjour").Value
End Sub
why am I not able to get my values in my combobox? Anyone? pleaaas?
Configuration: Windows / Chrome 53.0.2785.143
1 answer
-
Hello,
Should we assume that you have placed an ActiveX control "drop-down list" in a sheet?
If so, you can use the ListFillRange property of your ComboBox to specify the source.
If Nbrjour represents a named range,
you can specify it directly in design mode by entering Nbrjour in the ListFillRange field.
Alternatively, you can do it by macro using the instruction ComboBox2.ListFillRange = "Nbrjour"
See you later!