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 32 33 34 35 36 37 38
| With Worksheets("feuil1")
LigneCourante = 9
lignedebut = LigneCourante
AncienNom = .Cells(LigneCourante, 1).Value
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
Wend
End With
End Sub
Function alimentefeuille(a, b, c, d)
End Function |