Option Explicit
Private Sub worksheet_activate()
Dim i As Long
'Si la date est égale à celle du jour alors l'objet (Shapes) passe au NOIR et retrouve sa couleur initial si autre date
For i = 2 To 330
If Sheets("Feuil2").Cells(i, 1) = Date Then
ActiveSheet.Shapes("bouton").Fill.ForeColor.RGB = vbBlack
Exit Sub
Else
ActiveSheet.Shapes("bouton").Fill.ForeColor.RGB = RGB(255, 192, 0)
End If
If Sheets("Feuil2").Cells(i, 3) = Date Then
ActiveSheet.Shapes("bouton1").Fill.ForeColor.RGB = vbBlack
Exit Sub
Else
ActiveSheet.Shapes("bouton1").Fill.ForeColor.RGB = RGB(255, 192, 0)
End If
Next i
End Sub