Private Sub CommandButton2_Click()
MoveSelectedItem Me.ListBox1, Me.ListBox2
End Sub
Private Sub CommandButton3_Click()
MoveSelectedItem Me.ListBox2, Me.ListBox1
End Sub
Private Sub MoveAllData(xSource As Object, xDestination As Object)
Dim i As Long
For i = xSource.ListCount - 1 To 0 Step -1
xDestination.AddItem xSource.List(i, 0)
xDestination.List(xDestination.ListCount - 1) = xSource.List(i)
xSource.RemoveItem (i)
Next
End Sub
Private Sub CommandButton4_Click()
If Me.ListBox1.ListIndex < 0 Then
MoveAllData Me.ListBox2, Me.ListBox1
Else
MoveAllData Me.ListBox1, Me.ListBox2
End If
End Sub