Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove all Listbox items Todd Huttenstine Excel Programming 3 July 12th 04 09:56 PM
Adding Items to a ListBox-Unique Items Only jpendegraft[_14_] Excel Programming 2 May 2nd 04 02:27 AM
Items in a Listbox Todd Huttenstine Excel Programming 1 April 26th 04 03:36 PM
Technique to move (reorder) items in Listbox Stuart[_5_] Excel Programming 8 February 15th 04 10:26 PM
Sort Listbox Items Stratuser Excel Programming 2 January 17th 04 03:05 PM


All times are GMT +1. The time now is 07:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"