How can i achive to color each month on a column that has dates on it, for example all june dates have to be blue and February dates in green i have this code but only works referring with current date.
this is the code im using right now
Dim rCell As Range
ActiveWorkbook.Worksheets("Dates").Select
With Worksheets("Dates")
For Each rCell In .Range("H4", .Cells(.Rows.Count, 8).End(xlUp)).Cells
If rCell.Value <= Date Then
rCell.Interior.Color = vbRed
ElseIf rCell.Value <= Date + 30 Then
rCell.Interior.Color = vbYellow
ElseIf rCell.Value <= Date + 60 Then
rCell.Interior.Color = vbOrange
Else
rCell.Interior.Color = vbGreen
End If
Next rCell
End With
the problem is it only works if you are in the first of every month that have 30 days also. how can i archive this but for every month.
Bookmarks