PDA

View Full Version : Solved: color code range



john3j
05-05-2009, 09:20 AM
Hey guys can someone help me write code to color code a range? I actually have two ranges, K7:K87 and L7:L87.

For K7:K87 I need the following formatting to be done.

If the value of the cell in column "I" divided by the value of the cell in column "C" is >= "0.9", then color the cell in Column "K" red with bold font.

If the value of the cell in column "I" divided by the value of the cell in column "C" is < ".75", then color the cell in Column "K" White with bold font.

If the value of the cell in column "I" divided by the value of the cell in column "C" is between ".76" and ".89", then color the cell in Column K Orange with bold font.

This needs to be done for each row in the range.

Next I need the following done:

For the Range L7:L87

If the value of the cell in column "J" divided by the value of the cell in column "D" is >= "0.9", then color the cell in Column "K" red with bold font.

If the value of the cell in column "J" divided by the value of the cell in column "D" is < ".75", then color the cell in Column "K" White with bold font.

If the value of the cell in column "J" divided by the value of the cell in column "D" is between ".76" and ".89", then color the cell in Column K Orange with bold font.

I think this would be a select case but im not quite sure as how to do it. Any help would be appreciated.:banghead:

mdmackillop
05-05-2009, 10:32 AM
If the second part if your question should refer to Column L then you can do this with condtional formatting.
If it really refers to Column K, then how do you resove conflicts between conditions.

john3j
05-05-2009, 09:11 PM
I know I can use conditional formatting and I know how to do it and make it work. The problem is that I need to do this for every cell in that range. For some reason I can't copy the formatting to the rest of the range because it alwys uses the conditions from the first row. So if I copied the formatting down the range and clicked on the last cell in the range, it is still using the cells from the first row in the range. I really don't want to go thru 80 rows and do it manually. Suggestions?

Bob Phillips
05-06-2009, 01:15 AM
Then you must be doing something wrong. When I create CF over 80 rows, if I use relative references, it uses the appropriate row for each.

mdmackillop
05-06-2009, 02:59 AM
Then you must be doing something wrong. When I create CF over 80 rows, if I use relative references, it uses the appropriate row for each.
I concur