1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| With Worksheets("Etat - Data")
LigneCourante = 9
Do While .Cells(LigneCourante, 1).Value <> ""
If AncienNom = "" Then
'Initialisation des variables
LigneDebut = LigneCourante
AncienNom = .Cells(LigneCourante, 1).Value
End If
' Si les informations ont changé : calcul de la ligne fin
NouveauNom = .Cells(LigneCourante, 1).Value
If NouveauNom <> AncienNom Then
LigneFin = LigneCourante - 1
DonneesACumuler = True
AlimenteFeuille AncienNom, LigneDebut, LigneFin, DonneesACumuler
LigneDebut = LigneFin + 1
LigneFin = LigneCourante
AncienNom = NouveauNom
End If
' Passage à la ligne suivante
LigneCourante = LigneCourante + 1
Loop
End With |
Partager