dans le code ci dessous Franc58 m'a modifié ce dernier pour mettre en couleur la cellule de jour sélectionnée.
Cela fonctionne très bien.
VB:
For Each Cell In ActiveSheet.Range("B5:AF159")
If Cell.Value = [Today()] Then
Cell.Select
Cell.Interior.Color = RGB(0, 255, 0)
Cell.Font.Color = RGB(255, 0, 0)
End If
Next
J'avais oublié un détail.
Est-il possible de lui dire de colorier également les 10 cellules en dessous de la cellule sélectionnée ?
Function Tod(Cel As Range) As Boolean
If Cel = Date Then
Tod = True
Else
For L = Cel.Row To Application.Max(Cel.Row - 10, 1) Step -1
If Cells(L, Cel.Column) = Date Then
Tod = True
Exit For
End If
Next
End If
End Function
Function Tod(Cel As Range) As Boolean
If Cel = Date Then
Tod = True
Else
For L = Cel.Row To Application.Max(Cel.Row - 10, 1) Step -1
If Cells(L, Cel.Column) = Date Then
Tod = True
Exit For
End If
Next
End If
End Function