Bonjour Caro,
Là, votre demande est plus problématique, il faut ajouter une variable et changer le code
Voici une possibilité
Sub Vérif()
Dim dLig As Long, Lig As Long
Dim Inc As Integer, MaxC As Integer
With ThisWorkbook.Sheets("Feuil1")
dLig = .Range("A" & Rows.Count).End(xlUp).Row
For Lig = 2 To dLig
If .Range("E" & Lig).Value < 0 Then
Inc = Inc + 1
Else
Inc = 0
End If
' Mémoriser le max de consécutif
If Inc > MaxC Then MaxC = Inc
Next Lig
' Selon le nombre max de consécutifs
If MaxC > 3 And MaxC <= 6 Then
MsgBox "Attention, vous avez " & MaxC & " nombres de négatifs consécutifs !"
ElseIf MaxC > 6 Then
MsgBox "Attention, vous avez plus de 6 nombres de négatifs consécutifs !"
End If
End With
End Sub
A+