Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [H5]) Is Nothing Or Not IsDate([H5]) Then Exit Sub
Dim t, d As Object, i&, col As Variant
If FilterMode Then ShowAllData 'si la feuille est filtrée
t = Range("A14:A" & Range("A" & Rows.Count).End(xlUp).Row + 13).Resize(, 10)
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(t) - 13
If t(i, 1) <> "" Then d(t(i, 1)) = t(i, 10) 'mémorisation de la valeur en colonne J
Next
With Sheets("Consommations Mensuelles")
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
col = Application.Match([H5], .Rows(3), 0)
If IsNumeric(col) Then
t = .Range("A5:A" & .Range("A" & .Rows.Count).End(xlUp).Row + 4).Resize(, col)
For i = 1 To UBound(t) - 4
t(i, col) = d(t(i, 1))
Next
If i > 1 Then .Cells(5, col).Resize(i - 1) = Application.Index(t, , col) 'restitution
End If
.Activate 'facultatif
End With
End Sub