Change cell color based on date

mrkris1982

Active Member
Joined
Apr 16, 2009
Messages
407
Wondering how I could code the cell to change to a different color for 5 different scenariois:

Blank (no color) if no text is in the cell
Bright Green if text is in the cell for 0-24 hours (restart time if new text is added to existing text)
Yellow if text has been unchanged for 24-48 hours
Rose if text has been unchanged for 72 hours
Red if text has been unchanged for 96 hours

Any ideas?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
ideas - yes but first U must decide how you will track when a cell value is changed.
you probably need some vba Worksheet_Change events.
suggestion - create a hidden sheet with name corresponding to the one in question.
when the event Worksheet_Change appears record the event time in the hidden sheet in the location of the changed cell.
then a bit of conditional formatting shoul do the rest.
P.S.: you have 4 required conditions - Excel prior 2007 supports only 3.
 
Upvote 0
I am using Office 2003. I know I can use CF, but only three options.

I could make it only 3 conditions (<24 hrs, <36 hours & >36 hours) but I do not have any idea how to code this formula in CF
 
Upvote 0
if you know when the cell is changed and you call this moment TimeChanged then:
(<24 hours): now()-TimeChanged<1
(<36 hours): 1<=now()-TimeChanged<1.5
(>36 hours): now()-TimeChanged=>1.5

 
Upvote 0
There must be something more to it than just puttin it in CF because I tried it, then enterred text and the cell did not change colors.
 
Upvote 0
not exactly - first you must decide how you will assign a value to TimeChanged
and this value will be different for each cell - it must be automatically recorded somewhere on each change - some vba must be written - but i don't have time right now
maybe later or tomorrow
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

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