E
Eric
Guest
bonjour,
j'ai joint le fichier zip avec le code et le userform pour que vous puissiez faire les tests !
Qu'est-ce qui cloche dans ce code pour arriver à afficher les 10 premiers noms choisis à partide B13 et les suivants à partir de C13 !
Private Sub CommandButton1_Click()
a = 2
Range('A3') = 'EXPLOITATION du ' & Format(TextBox2, 'dd/mm/yyyy')
For b = 6 To 10
If a = 2 Then
Range('B' & b) = Format(Controls('TextBox' & a), 'dd mmmm yyyy')
Else
Range('B' & b) = Controls('TextBox' & a)
End If
a = a + 1
Next b
j = 13
l = 13
With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
If i < 10 Then
Cells(j, 2) = .List(i, 0) & ' ' & .List(i, 1)
.Selected(i) = False
Else
Cells(l, 3) = .List(i, 0) & ' ' & .List(i, 1)
.Selected(i) = False
End If
j = j + 1
l = l + 1
End If
Next i
End With
End Sub
merci par avance [file name=modele4.zip size=18711]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/modele4.zip[/file]
j'ai joint le fichier zip avec le code et le userform pour que vous puissiez faire les tests !
Qu'est-ce qui cloche dans ce code pour arriver à afficher les 10 premiers noms choisis à partide B13 et les suivants à partir de C13 !
Private Sub CommandButton1_Click()
a = 2
Range('A3') = 'EXPLOITATION du ' & Format(TextBox2, 'dd/mm/yyyy')
For b = 6 To 10
If a = 2 Then
Range('B' & b) = Format(Controls('TextBox' & a), 'dd mmmm yyyy')
Else
Range('B' & b) = Controls('TextBox' & a)
End If
a = a + 1
Next b
j = 13
l = 13
With ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
If i < 10 Then
Cells(j, 2) = .List(i, 0) & ' ' & .List(i, 1)
.Selected(i) = False
Else
Cells(l, 3) = .List(i, 0) & ' ' & .List(i, 1)
.Selected(i) = False
End If
j = j + 1
l = l + 1
End If
Next i
End With
End Sub
merci par avance [file name=modele4.zip size=18711]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/modele4.zip[/file]