Sub testclass()
Dim I As Integer
Range("a2" ).Select
Range("Feuil2!b2:Feuil2!z15" ).ClearContents
Do While ActiveCell.Offset(0, I) <> ""
I = 0
cpt = 0
Do While UCase(Range("feuil2!b2" ).Offset(cpt, 0)) <> "" And UCase(Range("feuil2!b2" ).Offset(cpt, 0)) <> UCase(ActiveCell)
cpt = cpt + 1
Loop
If ActiveCell >= 1 And ActiveCell < 20 Then
If ActiveCell.Offset(-cpt, I) >= 1 And ActiveCell.Offset(-cpt, I) < 10 Then
Range("Feuil2!c2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!c2" )
Else
If ActiveCell.Offset(-cpt, I) >= 10 And ActiveCell.Offset(-cpt, I) < 50 Then
Range("Feuil2!d2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!d2" )
Else
If ActiveCell.Offset(-cpt, I) >= 50 And ActiveCell.Offset(-cpt, I) < 100 Then
Range("Feuil2!e2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!e2" )
Else
If ActiveCell.Offset(-cpt, I) >= 100 And ActiveCell.Offset(-cpt, I) < 250 Then
Range("Feuil2!f2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!f2" )
Else
If ActiveCell.Offset(-cpt, I) >= 250 And ActiveCell.Offset(-cpt, I) < 500 Then
Range("Feuil2!g2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!g2" )
Else
If ActiveCell.Offset(-cpt, I) >= 500 And ActiveCell.Offset(-cpt, I) < 900 Then
Range("Feuil2!h2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!h2" )
Else
Range("Feuil2!i2" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!i2" )
End If
End If
End If
End If
End If
End If
Else
Range("feuil2!b10" ) = ActiveCell.Offset(0, 1) + Range("Feuil2!b10" )
End If
I = I + 1
Selection.Offset(1, 0).Select
Loop
End Sub |