Link to home
Create AccountLog in
Avatar of mrafanan

asked on

Copy ComboBOx list to another ComboBox

how can i Copy the first Combo BOx list to another Combo Box in the useform? I am trying to make multiple combo box list with the same list.
Avatar of rgn2121
Flag of United States of America image

Where are the lists coming from?  Your input or reading from a DB?
Any sample code...?
Avatar of mrafanan


I have this on one combo box,

Sub addMask()

combobox1.AddItem "A"
combobox1.AddItem "B"
combobox1.AddItem "C)"
combobox1.AddItem "D)"
combobox1.AddItem "E)"
combobox1.AddItem "F"

End Sub

I am making a form, so i would like this to be the same list in the combobox2 without retyping everything.
Avatar of Pratima
<asp:DropDownList ID="DropDownList1" runat="server">
        <asp:DropDownList ID="DropDownList2" runat="server">
        <asp:DropDownList ID="DropDownList3" runat="server">

  foreach ( ListItem item in DropDownList1.Items )
        foreach (ListItem item in DropDownList2.Items)
Use this....
ComboBox2.List = ComboBox1.List

Open in new window

Sorry, i chose the wrong zone, it should be excel macro.. :(
pratima_mcs - It might pay to read the question, the tags, and the zones it is posted in properly before posting nonsense.
Hi Web, where would i type that? in the userform_Initialize?
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
THANK YOU VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!