Dim DateJourRU1 As String, DateJourRU2 As String, DateJourRU3 As String, DateJourRU4 As String, _
Dim jour As Integer
Dim mois_courant As String
If Len(Month(Now)) <> 2 Then 'ajout d'un 0
mois_courant = "0" & Month(Now) 'si le numéro du mois est compris entre 1 (janv) et 9 (Sept)
End If 'afin d'avoir un numéro de mois toujours sur 2 caractères
jour = Format(Date, "d")
DateJourRU1 = Year(Now) & "_" & mois_courant & "_" & Day(Now) - 1
DateJourRU2 = Year(Now) & "_" & mois_courant & "_" & Day(Now) - 2
DateJourRU3 = Year(Now) & "_" & mois_courant & "_" & Day(Now) - 3
DateJourRU4 = Year(Now) & "_" & mois_courant & "_" & Day(Now) - 4
If jour <= "4" Then
If Len(Month(Now - 4)) <> 2 Then
mois_courant = "0" & Month(Now - 4)
End If
DateJourRU4 = Year(Now - 4) & "_" & mois_courant & "_" & Day(Now - 4)
If jour <= "3" Then
If Len(Month(Now - 3)) <> 2 Then
mois_courant = "0" & Month(Now - 3)
End If
DateJourRU3 = Year(Now - 3) & "_" & mois_courant & "_" & Day(Now - 3)
If jour <= "2" Then
If Len(Month(Now - 2)) <> 2 Then
mois_courant = "0" & Month(Now - 2)
End If
DateJourRU2 = Year(Now - 2) & "_" & mois_courant & "_" & Day(Now - 2)
If jour = "1" Then
If Len(Month(Now - 1)) <> 2 Then
mois_courant = "0" & Month(Now - 1)
End If
DateJourRU1 = Year(Now - 1) & "_" & mois_courant & "_" & Day(Now - 1)
End If
End If
End If
End If