I'm trying to move items from a list box with 3 columns to another list box with 3 columns. However, the code I'm using only moves the first column. How do I move all 3 columns over?
Here's the code:
Private Sub MoveBetLstBoxes(lstBoxFrom As ListBox, lstBoxTo As ListBox)
Dim item As Variant
If lstBoxFrom.ItemsSelected.Count = 0 Then
MsgBox "Please select an insurance company", vbOKOnly, "Error"
Else
Dim index As Integer
For Each item In lstBoxFrom.ItemsSelected
lstBoxTo.AddItem lstBoxFrom.ItemData(item)
lstBoxFrom.RemoveItem lstBoxFrom.ItemData(item)
Next
End If
End Sub
Here's the code:
Private Sub MoveBetLstBoxes(lstBoxFrom As ListBox, lstBoxTo As ListBox)
Dim item As Variant
If lstBoxFrom.ItemsSelected.Count = 0 Then
MsgBox "Please select an insurance company", vbOKOnly, "Error"
Else
Dim index As Integer
For Each item In lstBoxFrom.ItemsSelected
lstBoxTo.AddItem lstBoxFrom.ItemData(item)
lstBoxFrom.RemoveItem lstBoxFrom.ItemData(item)
Next
End If
End Sub