Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
If Not Intersect(Target, Columns("L")) Is Nothing Then
Set P = Target.Find("*", Target.Cells(Target.Count), , , xlByColumns, xlNext) 'Première cellule non vide
Set L = Target.Find("*", Target.Cells(1), , , xlByColumns, xlPrevious) 'Dernière cellule non vide
If Not L Is Nothing And Not P Is Nothing Then
For Each Cell In Range(P, L).Cells
Application.EnableEvents = False
Cell = UCase(Cell)
Select Case Cell
Case...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target.Cells
If Not Intersect(Cell, Columns("A")) Is Nothing Then
Application.EnableEvents = False
Cell = UCase(Cell)
Select Case Cell
Case "N": Cell.Offset(0, 2) = Cell.Offset(0, 2) + 1
Case "O": Cell.Offset(0, 2) = 0
Case Else: ' Rien
End Select
Application.EnableEvents = True
End If
Next
End Sub
=--(A2="N")
Option Explicit
Sub Essai()
Dim n&: n = Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
Dim t%, k As Byte, i&: Application.ScreenUpdating = 0
For i = 2 To n
With Cells(i, 1)
k = -(.Value = "N"): .Offset(, 1) = k
If k = 0 Then t = 0 Else t = t + 1
.Offset(, 2) = t
End With
Next i
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target.Cells
If Not Intersect(Cell, Columns("K")) Is Nothing Then
Application.EnableEvents = False
Cell = UCase(Cell)
Select Case Cell
Case "N": Cell.Offset(0, -4) = Cell.Offset(0, -4) + 1
Case "O": Cell.Offset(0, -4) = 0
Case Else: ' Rien
End Select
Application.EnableEvents = True
End If
Next
End Sub