PDA

View Full Version : VBA Newbie needs Listbox help



jaxrotors
11-06-2008, 02:14 PM
Hi,
I am trying to add an element to a Word form that will allow the user to select one item from a long list (300+ items). I initially tried to use a pulldown object to feed a value to the userform Listbox as an initial value. The idea is to use the alphabet as a shorter starting list to make the long list managable.
I ran into a problem with the "focus" on the object not allowing a change to the value without leaving the pulldown object and returning.
Now, as a work around, I'm trying to use two list boxes inside the userform. I want the first to load populated with A - Z and have the second list box to populate on user selection of a value in the first. For example, if the user selects A in the first box, the second box would list all of the items in the "A" array.
I can't find any information about how to do this, or if it is even possible. Can someone please point me in the right direction?

Thanks!
:banghead:

OTWarrior
11-07-2008, 04:05 AM
How about this:

http://vbaexpress.com/kb/getarticle.php?kb_id=968

You can use this to have just one dropdown, but change it's value on selection.

To be honest though, having 300+ items in a dropdown list is an awful lot. Is there any way you can divide it up in groups or sections (other than A-Z)?

fumei
11-07-2008, 10:24 AM
"having 300+ items in a dropdown list is an awful lot"

Have to strongly agree. I would not use such a beast.