=SIERREUR(RANG(K6;INDIRECT("$K$6:$K$"&5+$B$2);0);"")
=SIERREUR(RANG(K6;INDIRECT("$K$6:$K$"&5+$B$2);0)+NB.SI($N$5:$N5;$N5)-1;"")
=(LIGNE()<LIGNE(K$6)+B$2)*SOMMEPROD((LIGNE(K$6:K$25)<LIGNE(K$6)+B$2)*(K$6:K$25-LIGNE(K$6:K$25)/"1E12">=K6-LIGNE()/"1E12"))
Non, avec la 2ème formule de JHA si l'on copie B7:K7 sur B8:K8 il y a 2 fois le rang 5.Bonjour JHA,
Super ça marche !
Bonjour à tous bonjour Job, JHA,Bonjour à tous,
Pas besoin d'enregistrer en xls avec une version excel 2007
JHA
=(LIGNE()<LIGNE(K$6)+B$2)*SOMMEPROD((LIGNE(K$6:K$25)<LIGNE(K$6)+B$2)*(K$6:K$25>=K6))
=MAX(N6-NB.SI(N6:N$25;N6)+1;)
Et justement pour eux les formules avec SIERREUR ne fonctionneront pas !!!j'ai enregistré en xls pour ceux qui n'ont que 2003 et antérieur !
=SI(LIGNE()>5+$B$2;"";RANG(K6;INDIRECT("$K$6:$K$"&5+$B$2);0)+NB.SI(INDIRECT("$k$6:$k$"&5+MIN(LIGNE()-5;$B$2));K6)-1)
Private Sub Worksheet_Change(ByVal Target As Range)
With [B5].CurrentRegion.Resize(, 9)
If Intersect(Target, Union([B2], .Cells)) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
If FilterMode Then ShowAllData 'si la feuille est filtrée
.Cells(2, 13).Resize(Rows.Count - .Row) = "" 'RAZ
If Int(Val([B2])) < 1 Then Exit Sub
With .Cells(2, 1).Resize(Int(Val([B2])))
.Columns(12) = .Columns(1).Value 'N° en colonne M
.Columns(13) = .Columns(10).Value 'copie les valeurs de la colonne K en colonne N
.Columns(12).Resize(, 2).Sort .Columns(13), xlDescending, Header:=xlNo 'tri sur la colonne N
.Columns(13) = .Columns(1).Value 'N° en colonne N indiquant le classement
.Columns(12).Resize(, 2).Sort .Columns(12), xlAscending, Header:=xlNo 'tri dans l'ordre initial
.Columns(12) = "" 'RAZ de la colonne M
End With
End With
End Sub