ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Dynamic dropdowns (https://www.excelbanter.com/excel-discussion-misc-queries/155915-dynamic-dropdowns.html)

gramps

Dynamic dropdowns
 
Hi

-- What I need is in auserform a way of selecting a value from a dropdown
list and depending on the result 1 of 3 different lists of data being loaded
into a second dropdown list box in the same userform. I have seen
http://www.xldynamic.com/source/xld.Dropdowns.html But cannot see how to
incorporate this into a userform presumably via the Row Source property.
Many thanks.



Toppers

Dynamic dropdowns
 
I created 4 named ranges "List1" to "List4": "List1" had values 1,2,3.

The following code then set Combobox2 to reference the correct named range.

Hope you can adapt to your needs

Private Sub ComboBox1_Change()
ComboBox2.RowSource = "List" & ComboBox1.Value
End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "List1"
End Sub

HTH

"gramps" wrote:

Hi

-- What I need is in auserform a way of selecting a value from a dropdown
list and depending on the result 1 of 3 different lists of data being loaded
into a second dropdown list box in the same userform. I have seen
http://www.xldynamic.com/source/xld.Dropdowns.html But cannot see how to
incorporate this into a userform presumably via the Row Source property.
Many thanks.



Toppers

Dynamic dropdowns
 
...... should be ...

ComboBox2.RowSource = "List" & ComboBox1.Value+1


"Toppers" wrote:

I created 4 named ranges "List1" to "List4": "List1" had values 1,2,3.

The following code then set Combobox2 to reference the correct named range.

Hope you can adapt to your needs

Private Sub ComboBox1_Change()
ComboBox2.RowSource = "List" & ComboBox1.Value
End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "List1"
End Sub

HTH

"gramps" wrote:

Hi

-- What I need is in auserform a way of selecting a value from a dropdown
list and depending on the result 1 of 3 different lists of data being loaded
into a second dropdown list box in the same userform. I have seen
http://www.xldynamic.com/source/xld.Dropdowns.html But cannot see how to
incorporate this into a userform presumably via the Row Source property.
Many thanks.



gramps

Dynamic dropdowns
 
Thanx a million, works a treat.
--
Al


"Toppers" wrote:

I created 4 named ranges "List1" to "List4": "List1" had values 1,2,3.

The following code then set Combobox2 to reference the correct named range.

Hope you can adapt to your needs

Private Sub ComboBox1_Change()
ComboBox2.RowSource = "List" & ComboBox1.Value
End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "List1"
End Sub

HTH

"gramps" wrote:

Hi

-- What I need is in auserform a way of selecting a value from a dropdown
list and depending on the result 1 of 3 different lists of data being loaded
into a second dropdown list box in the same userform. I have seen
http://www.xldynamic.com/source/xld.Dropdowns.html But cannot see how to
incorporate this into a userform presumably via the Row Source property.
Many thanks.




All times are GMT +1. The time now is 08:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com