Re : Compteur et pas variable
Bonjour Gurgeh,
Merci pour ta réponse, mais il me fallait du vba
après avoir chercher un peu plus voici comment j'ai fait
For Each cel In .Range("D1
" & .Range("D65536").End(xlUp).Row)
Set deb = cel
Set fin = cel
1 If deb.Row = 1 Then GoTo 2
Set deb = deb.Offset(-1)
If deb <> cel Then Set deb = deb.Offset(1) Else GoTo 1
2 If fin.Row = Rows.Count Then GoTo 3
Set fin = fin.Offset(1)
If fin <> cel Then Set fin = fin.Offset(-1) Else GoTo 2
3 NBLARG = fin.Row - deb.Row + 1
pas1 = NBLARG / 200
pas = Int(pas1) + 1 'entier superieur
lin = 1
For lig = deb.Row To fin.Row Step pas
If lin <= 200 Then .Cells(lig, 21) = lin
lin = lin + 1
Next
Next