Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have created a conditional format rule for alternate row style. It changes the cell fill for the cell to some color. The problem i have with this is that It override any other formatting that is already on the cell. So if the cell already has a background fill it will override it. I don't want this to happen.enter image description here

How can i write another formula or change this formula so it does not do a fill when the cell already has fill.

Formula: =MOD(ROW()/2,1)>0

share|improve this question

1 Answer 1

Define the following UDF to return the color of a cell

Public Function InteriorColor(Arange As Range)
InteriorColor = Arange.Interior.ColorIndex
End Function

Now change your conditional formatting, starting at C6 and copying down

=AND(InteriorColor(C6)=-4142,MOD(ROW()/2,1)>0)

ColorIndex -4142 is no fill (xlColorIndexNone) , so this only applies formatting if there is no existing fill.

share|improve this answer
    
Thank you for your answer @user2465348, saves me a lot of time. I am using openXML to do all of these in c#. Hopefully i get it working. Thank you once again. –  user2473013 Jun 11 '13 at 23:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.