bonjour,
j'ai essayer d'écrire ce code, mais ça ne me renvoie pas du tout la valeur attendue, j'ai essayé plusieur solution mais ça ne change rien.
merci de votre aide par avance
Sub test()
Dim ligne As String
ligne = 5
Do While Cells(ligne, 1).Value <> ""
If Cells(ligne, 8).Value >= "42" Then
Cells(ligne, 9).Value = "8"
Else
If Cells(ligne, 8).Value >= "36" Then
Cells(ligne, 9).Value = "7"
Else
If Cells(ligne, 8).Value >= "30" Then
Cells(ligne, 9).Value = "6"
Else
If Cells(ligne, 8).Value >= "24" Then
Cells(ligne, 9).Value = "5"
Else
If Cells(ligne, 8).Value >= "18" Then
Cells(ligne, 9).Value = "4"
Else
If Cells(ligne, 8).Value >= "12" Then
Cells(ligne, 9).Value = "3"
Else
If Cells(ligne, 8).Value >= "6" Then
Cells(ligne, 9).Value = "2"
Else
If Cells(ligne, 8).Value >= "1" Then
Cells(ligne, 9).Value = "1"
Else
End If
End If
End If
End If
End If
End If
End If
End If
ligne = ligne + 1
Loop
End Sub