Configuration: Windows XP Internet Explorer 6.0
Hello,
Maybe you can try this macro. I supposed that the dates were in column A, but you can modify it as you want : Sub auto_open()
DerCell = Range("A2").End(xlDown).Address
Set MyPlage = Range("A2:" & DerCell)
Dim MyDate As Date
MyDate = Now + 7
For Each Cell In MyPlage
If Cell.Value < Now Then
Cell.EntireRow.Interior.ColorIndex = 3
End If
If Cell.Value >= Now And Cell.Value <= MyDate Then
Cell.EntireRow.Interior.ColorIndex = 6
End If
If Cell.Value > MyDate Then
Cell.EntireRow.Interior.ColorIndex = 4
End If
Next
End Sub
I hope this will help you. Bye "Pour trouver une solution � ses probl�mes, il faut s'en donner la peine."
|
Hai
May I suggest that you look up IF statements in Excel Help so you'll understand the "value if true", "value if false" mechanism? Then Google Nested IF for a deeper understanding. Basically, you only want the Conditional Formatting to check the date if the cell is not empty and a Nested IF formula handles that nicely. IF the cell is not empty, then IF the date is <TODAY()... =IF($A1<>"",IF($A$1<TODAY(),TRUE, FALSE))
|
Résultats pour Excel question conditional format
Résultats pour Excel question conditional format
Résultats pour Excel question conditional format
Résultats pour Excel question conditional format
Résultats pour Excel question conditional format