IF function and combobox
Solved
Skyner68
Posted messages
3
Status
Member
-
Skyner68 Posted messages 3 Status Member -
Skyner68 Posted messages 3 Status Member -
Hello,
I created a small application for work in which I use comboboxes located in userforms that I configured for the data source like this:
It works perfectly!
My question is
Can we, using the if function (or another), automatically modify the data range based on the value of a given cell?
Basically, if A1=house then we take for combobox1 the range A1:A12 and if it’s garage then we take the range B1:B12.
Thank you in advance.
I created a small application for work in which I use comboboxes located in userforms that I configured for the data source like this:
private sub userform_initialize()
Combobox1.list = sheets ("param"). Range ("a2:a17").value
End sub
It works perfectly!
My question is
Can we, using the if function (or another), automatically modify the data range based on the value of a given cell?
Basically, if A1=house then we take for combobox1 the range A1:A12 and if it’s garage then we take the range B1:B12.
Thank you in advance.
Ah yes, but the instructions are in English not in French......
Little joke
Private Sub userform_initialize() With Sheets("param") If .Range("A1") = "maison" Then Set plage = .Range("A2:A17") ElseIf .Range("A1") = "garage" Then Set plage = .Range("B2:B17") Else End If ComboBox1.List = plage.Value End With End Sub