Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reorder items in listbox
I would like to reorder items in a listbox. Possibilities include sorting
the items or dragging and dropping an item to its nes position. The data is not bound to cells in a sheet. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reorder items in listbox
Dim v as Variant, i as long, j as Long
Dim swap as String v = Userform1.Listbox1.List For i = lbound(v) to ubound(v)-1 For j = i + 1 To ubound(v) If v(i) v(j) Then Swap = v(i) v(i) = v(j) v(j) = Swap End If Next j Next i Useform1.Listbox1.List = v -- Regards, Tom Ogilvy "Marvin" wrote in message ... I would like to reorder items in a listbox. Possibilities include sorting the items or dragging and dropping an item to its nes position. The data is not bound to cells in a sheet. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove all Listbox items | Excel Programming | |||
Adding Items to a ListBox-Unique Items Only | Excel Programming | |||
Items in a Listbox | Excel Programming | |||
Technique to move (reorder) items in Listbox | Excel Programming | |||
Sort Listbox Items | Excel Programming |