J
John
I'm trying to get conditional formatting working in Excel 2007 using VB.NET
2005, and I can't figure out how to get the expression to work so that it's
relative to the current cell. I've tried using A1 notation, R1C1 notation,
selecting the range I'm putting the formatting on. Everything I've tried so
far results in the exact same expression being used in all cells where the
formatting is applied. Specifically, I'm trying to add formatting to a range
that is something like M15:O200. My statement right now is something along
the lines of this:
valuesRange.FormatConditions.Add(Excel.XlFormatConditionType.xlExpression, ,
"=AND(RC[-1]=""DELTA"", RC=0)")
So in M17, for example, I'd like the formulat to be "=AND(L17="DELTA",M17=0)"
However, in all cells in the entire range, the formula always says
"=AND(L15="DELTA",M15=0)"
To make matters more confusing, it looks like the formula actually is
working in column M (not in N or O). For example, if I look at the formula
in M20, for example, it says "=AND(L15="DELTA",M15=0)", but it's being
evaluated as if it's actually checking cells L20 and M20.
Can anyone shed any light on this. I've searched all over, and can't find
any documentation on how cell references work within the expression when
doing this.
Thanks!
2005, and I can't figure out how to get the expression to work so that it's
relative to the current cell. I've tried using A1 notation, R1C1 notation,
selecting the range I'm putting the formatting on. Everything I've tried so
far results in the exact same expression being used in all cells where the
formatting is applied. Specifically, I'm trying to add formatting to a range
that is something like M15:O200. My statement right now is something along
the lines of this:
valuesRange.FormatConditions.Add(Excel.XlFormatConditionType.xlExpression, ,
"=AND(RC[-1]=""DELTA"", RC=0)")
So in M17, for example, I'd like the formulat to be "=AND(L17="DELTA",M17=0)"
However, in all cells in the entire range, the formula always says
"=AND(L15="DELTA",M15=0)"
To make matters more confusing, it looks like the formula actually is
working in column M (not in N or O). For example, if I look at the formula
in M20, for example, it says "=AND(L15="DELTA",M15=0)", but it's being
evaluated as if it's actually checking cells L20 and M20.
Can anyone shed any light on this. I've searched all over, and can't find
any documentation on how cell references work within the expression when
doing this.
Thanks!