K
KimberlyC
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
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