Dim date_jour As Date
date_jour = Format(Now, "dd/mm/yyyy")
Dim date_histo(2 To 5) As Date
date_histo(2) = "01/09/2019"
date_histo(3) = "01/10/2019"
date_histo(4) = "01/11/2019"
date_histo(5) = "01/12/2019"
Dim N As Integer
Dim M As Integer
For N = 2 To 5
M = N - 1
If Year(date_histo(N)) = Year(date_jour) And Month(date_histo(N)) = Month(date_jour) Then
Range("B" & N) = Range("C2")
ElseIf Year(date_histo(N)) = Year(date_jour) And Month(date_histo(N)) < Month(date_jour) And Range("B" & N) = 0 And Range("B" & M) <> "valeur_histo" Then
Range("B" & N) = Range("B" & M)
ElseIf Year(date_histo(N)) = Year(date_jour) And Month(date_histo(N)) < Month(date_jour) And Range("B" & N) = 0 And Range("B" & M) = "valeur_histo" Then
Range("B" & N) = Range("C2")
ElseIf Year(date_histo(N)) < Year(date_jour) And Month(date_histo(N)) > Month(date_jour) And Range("B" & N) = 0 Then
Range("B" & N) = Range("B" & M)
ElseIf Year(date_histo(N)) = Year(date_jour) And Month(date_histo(N)) > Month(date_jour) And Range("B" & N) <> 0 Then
Range("B" & N) = 0
ElseIf Year(date_histo(N)) > Year(date_jour) And Month(date_histo(N)) < Month(date_jour) And Range("B" & N) <> 0 Then
Range("B" & N) = 0
End If
Next N