Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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
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
how to drag items within listbox MP Excel Discussion (Misc queries) 0 January 15th 09 03:56 PM
Moving Mutli-Column Multiple-Selected Listbox items up or down MP Excel Discussion (Misc queries) 0 January 14th 09 09:34 PM
listing items from listbox Gerry[_5_] Excel Programming 2 October 18th 03 02:45 AM
Counting items in a listbox Thurman Excel Programming 0 September 5th 03 06:36 AM
Checking Listbox Items Tim[_15_] Excel Programming 1 July 20th 03 05:27 PM


All times are GMT +1. The time now is 06:47 AM.

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"