Private Sub Worksheet_Activate()
For Each c In Range("A7:A166")
c.FormulaR1C1 = "=IF(OR(RC[14]="""",RC[15]>0),"""",""Not Valide"")"
Next c
End Sub
Private Sub Worksheet_Activate()
For i = 7 To 166
If Not (Cells(i, 15).Value = "" Or 0 > Cells(i, 16).Value) Then
Cells(i, 1).Formula = "Not Valide"
End If
Next i
End Sub
Et en utilisant SpecialCells, ça joue aussi
Private Sub Worksheet_Activate()
On Error Resume Next
Set a = Union(Range("O7:O166"), Range("P7166")).SpecialCells(xlCellTypeConstants)
a.Offset(, -14).Resize(, 1) = "Not Valide"
End Sub