Bonjour,
Procédure à placer dans le module de la feuille concernée :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range, c As Range, n&
n = Me.UsedRange.Rows.Count
Set isect = Intersect(Target, Me.Range("D2:F" & n))
If Not isect Is Nothing Then
For Each c In isect
c.Interior.Color = Me.Cells(c.Row, 2).Interior.Color
Next c
End If
End Sub
Cordialement.
Petite rectification pour qu'elle enlève également la couleur si pas de valeur numérique...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range, c As Range, n&
n = Me.UsedRange.Rows.Count
Set isect = Intersect(Target, Me.Range("D2:F" & n))
If Not isect Is Nothing Then
For Each c In isect
If c.Value <> "" And IsNumeric(c.Value) Then
c.Interior.Color = Me.Cells(c.Row, 2).Interior.Color
Else
c.Interior.ColorIndex = xlColorIndexNone
End If
Next c
End If
End Sub