请教各位大神:
如何用条件格式 实现,当前单元格值不等于“正确”时背景颜色为红色,下面的代码测试无法实现,代码哪里有误望指出,谢谢!
int rowIndex =4;
spread.ActiveSheetView.Cells[4, 12].Formula = string.Format("IF(ABS((D{0}+{1})-G{0})=0,\"正确\",(D{0}+{1})-G{0})", rowIndex + 1, 100);
FarPoint.Web.Spread.NamedStyle styleCold = new FarPoint.Web.Spread.NamedStyle();
styleCold.BackColor = Color.Red;
spread.ActiveSheetView.SetConditionalFormat(4, 12, styleCold, FarPoint.Web.Spread.ComparisonOperator.LessThan, "正确");
spread.ActiveSheetView.SetConditionalFormat(4, 12, styleCold, FarPoint.Web.Spread.ComparisonOperator.GreaterThan, "正确");
谢谢!
|
|