Conditional Formatting progress tracker.

james.benham

New Member
Joined
Jul 1, 2009
Messages
6
Hi
I have to produce an excel spreadsheet with conditional formatting:
The spreadsheet is a progress monitor on various stages of projects. Each project has a target completion date and three stages. Stage 1 is meant to be completed 30 days before the target completion, stage 2 is meant to be 20 days and stage 3 completed 10 days before completion.
In column a is a list of projects, columb H is their target completion dates, column M,Nand O have the dates when the 3 stages have been completed c=stage 1, d=stage 2 etc...
The dates are entered into the appropriate cells as and when the project reaches each stage. I want the cells to have the formats as follows:

In the below code Cell M14 is where the target time (30 days before completion) is stored.


"complete": grey
some other text: brown
Blank: White
Date more than two days earlier than target date for that particular stage: blue
date two days either side of target date: green
Date upto 10 days late: orange
Date between 10 and 20 days late: pink
Dater over 20 days: flashing red or pop up message each time somebody opens the spreadsheet (if this is possible. if not then just deep red)
Any help would be appreciated.



This is what I'm working on at the moment but a few things are not working. This is just for the M column

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
    If Not Intersect(Target, Range("M15:M34")) Is Nothing Then
 
        Select Case Target
            Case 0
                icolor = 2
            Case "complete"
                icolor = 15
            Case Is > (Range("I15").Value + Range("M14").Value + 20)
                icolor = 3
            Case Is > (Range("H15").Value + Range("M14").Value + 10)
                icolor = 38
            Case Is > (Range("H15").Value + Range("M14").Value + 5)
                icolor = 40
            Case Is > (Range("H15").Value + Range("M14").Value + 2), Is > (Range("H15").Value + Range("M14").Value - 2)
                icolor = 35
            Case Is > (Range("H15").Value + Range("M14").Value - 10)
                icolor = 34
            Case Else
                icolor = 53
 
        End Select
 
        Target.Interior.ColorIndex = icolor
    End If
 
End Sub

So i think Ive got some of the basics, I can't get it to detect if a cell has text in it I was going to leave it to Cse Else, but I think excel considers text as fulfilling the 3rd case as the cell turns red if I enter "fshfjkg" for example.

Also, I am comparing each cell to H15 rather than their own H row cell.

Thanks Again,

James
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top