How to set the style for an entire column in EPPlus?

最后都变了- 提交于 2019-12-01 16:17:41
 int indexOfColumn = ...;
 worksheet.Column(indexOfColumn).Style.Font.Color.SetColor(Color.Red);

Try using ranges; I was having a problem with using numbers as well.

//Get the final row for the column in the worksheet
int finalrows = worksheet.dimension.End.Row;

//Convert into a string for the range.
string ColumnString = "A1:A" + finalrows.ToString();

//Convert the range to the color Red
worksheet.Cells[ColumnString].Style.Font.Color.SetColor(Color.Red);

Hopefully this works,but I didn't try it out.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!