' Si on est lundi :
If Weekday(Now()) = 2 Then
' alors on commence l'itération au vendredi :
Day_Offset = -3
Else
' sinon on commence hier :
Day_Offset = -1
End If
' On ne va pas plus loin que aujourd'hui :
Do While Day_Offset < 1
' le répertoire à vérifier est le comme cela :
Location = Cells(client, 8).Value & Format(Now(), "yyyy") & "\" & Format(Now(), "mm") & "\" & Format(Now() + Day_Offset, "dd") & "\"
' si le répertoire n'existe pas :
If Len(Dir(Location, vbDirectory)) = 0 Then
' alors cellule en rouge :
Cells(client, 9).Interior.ColorIndex = 3
Else
' si le répertoire existe -->: cellule verte
Cells(client, 9).Interior.ColorIndex = 10
End If
' on passe au jour suivant :
Day_Offset = Day_Offset + 1
Loop