我已经以编程方式制作了一张excel表.现在我想在特定的单元格范围上添加条件格式.
格式化类型是所有单元格 values greater than 0 (>0)
怎么去做呢?在excel中,我可以使用内置公式来实现Cell Values Greater Than.但是如何使用C#和epplus将它嵌入excel?
我找到了解决这个问题的确切方法.所以添加我自己的解决方案
var cellAddress = new ExcelAddress(
<startingRow>,
<startingcolumn>,
<endingRow>,
<endingColumn>);
var cf = ws.ConditionalFormatting.AddGreaterThan(cellAddress);
cf.Formula = "0";
cf.Style.Fill.BackgroundColor.Color = Color.LightGreen;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3485 次 |
| 最近记录: |