Private Sub CommandButton1_Click()
Dim I As Integer
If CheckBox1 = True Then
For I = 0 To ListBox1.ListCount - 1
ActiveCell.Offset(I, 0) = ListBox1.List(I)
Next I
End If
For I = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(I) = True Then ListBox2.AddItem ListBox1.List(I)
Next I
For I = 0 To ListBox2.ListCount - 1
If ListBox2.Selected(I - counter) Then
ListBox2.RemoveItem (I - counter)
counter = counter + 1
End If
Next I
For I = 0 To ListBox2.ListCount - 1
ActiveCell.Offset(I, 0) = ListBox2.List(I)
If Worksheets.Application.CountIf(Range("$C$9:$L$27"), ActiveCell) > 0 Then
MsgBox "attention doublon"
End If
Next I
Unload UserForm1
'ActiveCell.Offset(0, 1).Select
End Sub