我以编程方式制作了一个 Excel 工作表。现在我想在特定的单元格范围内添加条件格式。
格式化类型是所有值大于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;
关于c# - 如何使用 epplus 在值大于特定常量值的单元格上添加条件格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22220551/