PDA

View Full Version : Ordering a listbox



Maka
05-27-2006, 05:25 PM
Hi, i was wondering if there is any instruction to order (by number or alpha) a combobox or a listbox. currently i have a function that compares each one of the entries and orders it but when I go over 500 entries it takes quite a while.

pd: is .zorder what im looking for? cause if it is its not working

jindon
05-27-2006, 06:12 PM
Hi

How are you populating the List/Combo Box?

Single / Multi collumn?

Jacob Hilderbrand
05-27-2006, 10:25 PM
ZOrder refers to the placement of the control and doesn't have anything to do with the data in the control.

Like jindon stated, it will depend on how you are filling the control. If you are using a Row Source, then just make sure the data is already sorted. If you are using AddItem, then just make sure the data is sorted first.

For Add Item, what I would do (assuming the starting data is not sorted and you do not want to change it to be sorted) is load all the data to an usused column, then sort the column, load the data to the control, then clear the data in the column.

Howard Kaikow
05-28-2006, 01:13 AM
Hi, i was wondering if there is any instruction to order (by number or alpha) a combobox or a listbox. currently i have a function that compares each one of the entries and orders it but when I go over 500 entries it takes quite a while.

pd: is .zorder what im looking for? cause if it is its not working

It is far more efficient to NOT use Excel's built-in sorting.

See http://www.standards.com/index.html?Sorting.