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
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
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: