Private Sub CommandButton1_Click()
If Me.TB2 = "" Then Me.ListBox1.ListIndex = -1: Exit Sub
For i = 0 To ListBox3.ListCount - 1 'on boucle sur tout les items de la listbox3
If ListBox3.List(i, 1) = Me.TB2 Then Exit Sub 'si l'item est déjà en listbox3 on sort
Next i
'sinon on ajout l'item
ListBox3.AddItem
pos = Me.ListBox3.ListCount - 1
Me.ListBox3.List(pos, 0) = Me.TB1 'N° Equipe
Me.ListBox3.List(pos, 1) = Me.TB2 'N° planning
Me.ListBox3.List(pos, 2) = Me.TB3 'Nom
Me.ListBox3.List(pos, 3) = Me.TB4 'Prénom
Me.ListBox3.List(pos, 4) = Me.TB5 ' SSF
ListBox2.AddItem
pos = Me.ListBox2.ListCount - 1
Me.ListBox2.List(pos, 0) = Me.TB1 'N° Equipe
Me.ListBox2.List(pos, 1) = Me.TB2 'N° planning
Me.ListBox2.List(pos, 2) = Me.TB3 'Nom
Me.ListBox2.List(pos, 3) = Me.TB4 'Prénom
Me.ListBox2.List(pos, 4) = Me.TB5 ' SSF
Me.TB2 = ""
Me.TB3 = ""
Me.TB4 = ""
Me.TB5 = ""
Me.ListBox1.ListIndex = -1
Me.CommandButton5.Visible = True
End Sub