Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox--moving items up or down
Hi
I don't know how to allow a user to move values in list box, but you could have a 2nd listbox which can be populated from the first listbox by the user, in whatever order they want? The values in the 2nd listbox could then be copied to the sheet. libby -----Original Message----- Hi I have a user form that has a listbox in it. The listbox is populated from a row of data on a worksheet using the following code that this news group gave me: Private Sub UserForm_Initialize() Dim x As Long For x = 3 To 13 listbox1.AddItem (Sheets("Worksheet ").Cells (9, x)) Next It works great! I would like to be able to allow the user to move the items up or down and put them in the order of their choice. Once it's in the order of their choice, they then select the items they want, and those items are copied to another worksheet using this code: Dim i As Integer Dim j As Integer With listbox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Range("codestosummary").Offset(j, 0).Value = .List (i) j = j + 1 End If Next i End With I'm having trouble with the part of allowing the user to move the items up or down to get them in the order they prefer. I'm sure how this would be done!! Any help with this would be greatly appreciated. Thanks in advance. Kimberly . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to drag items within listbox | Excel Discussion (Misc queries) | |||
Moving Mutli-Column Multiple-Selected Listbox items up or down | Excel Discussion (Misc queries) | |||
listing items from listbox | Excel Programming | |||
Counting items in a listbox | Excel Programming | |||
Checking Listbox Items | Excel Programming |