lig = rechercheligne("Feuil4", "A", Label2.Caption, 1, 2) 'recherche des lignes contenant le nom du client
If lig = 0 Then Exit Sub ' pas de client, on sort
compteur = 0 ' initialisation du compteur
Do While lig > 0 ' tant que lig >0 'c'est à dire que l'on trouve le même nom de client
compteur = compteur + 1 ' on ajoute 1 au compteur
ComboBox1.AddItem Sheets("feuil4").Range("B" & lig) [b]' ca je ne comprends pas ..........[/b]
total = total + Sheets("feuil4").Range("D" & lig) 'variable total = variable total + montant dernière facture
If compteur = 11 Then ' il faut initialiser les données '
total = Sheets("feuil4").Range("D" & lig) [b]' donc ici .. si on trouve 11 fois le même nom, alors on initialise le compteur sur 1, et on donne à la variable total la valeur de la dernière ligne trouvée ? [/b]
compteur = 1
End If
lig = rechercheligne("Feuil4", "A", Label2.Caption, 1, lig + 1) ' et on poursuit la recherche de ce même client à partir de cette dernière ligne ?
If lig = 0 Then Exit Do ' on sort
Loop
Label8.Visible = False
Label9.Visible = False
If compteur = 10 Then
Label8.Visible = True
Label9.Visible = True
Label8.Caption = total
Label9.Caption = total * 0.1