Dennistoun Dark
New Member
- Joined
- Jun 1, 2016
- Messages
- 28
I am looking to use a Case statement to change the font colour of a date: today's date, a date in the future and a date past.
I have tried the following using Date Today and Now but get an error each time.
'Colour cells based upon value (column J)
Select Case Cell.Offset(0, -2).Value
Case Today
Cell.Offset(0, -2).Interior.FontIndex = 2
Case Is < Today
Cell.Offset(0, -2).Interior.FontIndex = 1
Case Is > Today
Cell.Offset(0, -2).Interior.FontIndex = 4
If Cell.Value = "C" Then Cell.Offset(0, -2).Font.ColorIndex = 1
End Select
The general format of Case is fine because I am using it to change actions in a number of column and rows bed upon txt strings. The column offset from row L is correct as well because I can use Case statements on text strings to change it.
Any help would be appreciated.
Cheers
Frank
I have tried the following using Date Today and Now but get an error each time.
'Colour cells based upon value (column J)
Select Case Cell.Offset(0, -2).Value
Case Today
Cell.Offset(0, -2).Interior.FontIndex = 2
Case Is < Today
Cell.Offset(0, -2).Interior.FontIndex = 1
Case Is > Today
Cell.Offset(0, -2).Interior.FontIndex = 4
If Cell.Value = "C" Then Cell.Offset(0, -2).Font.ColorIndex = 1
End Select
The general format of Case is fine because I am using it to change actions in a number of column and rows bed upon txt strings. The column offset from row L is correct as well because I can use Case statements on text strings to change it.
Any help would be appreciated.
Cheers
Frank