23/01/2020, 07:28
Private Sub lb1_Click()
Dim posn As Integer
Dim find As String
'find and remove selected from txtCando
find = ";" & lb1.Column(1) & ";"
posn = InStr(1, txtCanDo, find)
txtCanDo = Left(txtCanDo, posn - 1) & Mid(txtCanDo, posn + Len(lb1.Column(1)) + 1)
'move selection to lb2
lb2.AddItem lb1.Column(0) & ";" & lb1.Column(1)
lb1.RemoveItem (lb1.ListIndex)
End Sub
Dim posn As Integer
Dim find As String
'find and remove selected from txtCando
find = ";" & lb1.Column(1) & ";"
posn = InStr(1, txtCanDo, find)
txtCanDo = Left(txtCanDo, posn - 1) & Mid(txtCanDo, posn + Len(lb1.Column(1)) + 1)
'move selection to lb2
lb2.AddItem lb1.Column(0) & ";" & lb1.Column(1)
lb1.RemoveItem (lb1.ListIndex)
End Sub