Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Intersect(Target, [A:A])
If Target Is Nothing Then Exit Sub
Target.Interior.ColorIndex = xlNone 'RAZ
On Error Resume Next 'si aucune SpecialCell
If Target.Count > 1 Then Target.SpecialCells(xlCellTypeConstants).Interior.Color = [D2].Interior.Color _
Else If Target <> "" Then Target.Interior.Color = [D2].Interior.Color
End Sub
Sub EntreeAutomatique() 'bouton Entrée
Dim Target As Range
ActiveCell.Activate 'si Selection n'est pas un Range
Set Target = Intersect(Selection, [A:A])
If Target Is Nothing Then Exit Sub
Application.EnableEvents = False 'désactive les évènements
Target = Application.RandBetween(1, 1000) 'entrées quelconques
Application.EnableEvents = True 'réactive les évènements
Target.Interior.ColorIndex = xlNone 'RAZ
On Error Resume Next 'si aucune SpecialCell
If Target.Count > 1 Then Target.SpecialCells(xlCellTypeConstants).Interior.Color = [D3].Interior.Color _
Else If Target <> "" Then Target.Interior.Color = [D3].Interior.Color
End Sub