It is straight forward to format a cell based on a formula in conditional formatting, however what I am trying to do is sort of the reverse....
I want to write a conditional formula based on the format (i.e. colour) of particular cells.
Is this possible ?? If so, I would very much like to know how to achieve it.
|Check out our Excel Resources|
Public Function GetColorIndex(cl As Range) As Integer
GetColorIndex = cl.Interior.ColorIndex
Ok, now in your workbook you can use this formula. So say Cell A1 has a light yellow background. In cell B1, if you type the following:
It should return 36. So you could base your formula on the number this returns, or just use it in your formula something like this:
IF(GETCOLORINDEX(A1) > 30, A1+A2, "")
Hope this makes sense & helps,
Worked like a charm....
Thankyou very much.... You just saved me literally hours of work....