PDA

View Full Version : Solved: Conditional Formatting Help excel 2003



VNouBA
05-18-2012, 07:13 AM
Good morning/Evening,
I have a little blank spot...

I am trying to figure out this formula but right now it's not working.

I need when it's 7 days from the delivery date to turn bleu and after the delivery date to turn red.

this is what I have:

Cond. #1: =(O5-TODAY())<7
Cond. #2 =(O5-TODAY())<14

One: Is this correct?

How do i make this in a VB code in Column O (From O5 to O1000)

mikerickson
05-18-2012, 07:26 AM
One: Did it work the way you want it to when you tried it?
Two: Why use VBA when Excel's Conditional Formatting is easier and more robust?

VNouBA
05-18-2012, 07:31 AM
One: No it turns bleu even after the date has passed. and Red one month before the date.

Example: I have a delivery date on July 19, 2012 and the info is in Red. we are only May 18, 2012 therefore should be in black.


Two: VB because the user will not be able to change any information from the Excel Sheet. Plus I will be the admin of this workbook therefore I will be able to see the errors if the user complains

VNouBA
05-18-2012, 07:44 AM
But I guess I could keep it in Conditional formatting cause they would have to go in the format menu...

So yes I can keep it as Conditional Formatting and not VB Code.

Column O has all the same C.F. but none of them is working.

I have one that was delivered on Feb. 26, 2012 and not red.
I have one that will be delivered on May 23, 2012 and not bleu.

Bob Phillips
05-18-2012, 07:55 AM
If you put the red condition first, if it is > 14 days old it will pass, bit so will the blue condition, and the second will take preference unless you tell the CF to stop on true.

Best to put the blue condition first, red second.

VNouBA
05-18-2012, 08:09 AM
Cond. #1 =(O5-TODAY())>7 (Blue)
Cond. #2 =(O5-TODAY())<7 (Red)

My god to many days in VB coding can make you go insane lol

Thanks guys it's working now.

I need a refresh course :think: