Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate a combo box from another worksheet

Status
Not open for further replies.

Pudsters

Technical User
Mar 16, 2006
151
US
I have a Combo Box on a User Form with the following items. But I want to put these items in a named range list on sheet2, called "Items" because there will be many more items added. How do I change the code so it pulls from that list instead of writing it here?

With cboDescriptions
.AddItem "apples"
.AddItem "pears"
.AddItem "peaches"
.AddItem "oranges"
.AddItem "grapes"

End With
cboDescriptions.Value =
 
You can do this easily, without using code.[ol]
[li]Create your list on Sheet2.[/li]
[li]Name the range comprising the list Items (or whatever you want).[/li]
[li]Click the ComboBox on the Userform to activate it.[/li][li]Scroll down in the Properties Window and find the RowSource property. If the Property Window isn't displayed, select View|Properties Window from the menu. Enter the named range as its value (Items in this example).[/li]
[/ol]
That's all. When you run the Userform and select that Combo Box, all of the items in the named range Items will be listed.


Regards,
Mike
 
Wow, that really was easy. Thanks MIKE! As a beginner I really appreciate you spelling it out for me. Maybe you could help me with my other post about limiting the number of entries made to an invoice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top