PDA

View Full Version : Conditional formatting according to range



pbobadilla
09-20-2012, 01:34 PM
Hello,

I am trying to apply a background color (yellow) for any cells in the range c12:c511 if any of the cells within each row (range a:ch ) is blank then the cell in column c turns yellow. For ex: If any cell from a12:CH12 is blank, then c12 turns yellow. This would be applied to each row until c511 is reached. Is there any way to do this for all rows with VBA code instead of having to apply a specific conditional formatting through the "manage rules" section of excel. Any help would be appreciated.

Thanks,

Pablo

CatDaddy
09-20-2012, 01:39 PM
For each cell in Range("A12:CH512")
If cell.value = "" Then cell.Interior.ColorIndex = 6
Next cell

pbobadilla
09-20-2012, 02:28 PM
Thanks! Where do I enter the code and/or is there anything I have to type before it to activate it?

pbobadilla
09-21-2012, 10:30 AM
Thanks! Where do I enter the code and/or is there anything I have to type before it to activate it?

Do I set it up as an event? Prodcedure? or module?

Thanks,