questionRowIndex.Add(j);
style.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.Red.Index;
/*修改指定单元格样式 如果要修改行样式则需要将row.Cells.Count循环出来,挨个设置!*/
row.Cells[5].CellStyle = style;
//for(int i=0;i //{ // row.Cells[i].CellStyle = style; //} /*重新修改文件指定单元格样式*/ FileStream fs1 = System.IO.File.OpenWrite(readExcelPath); workbook.Write(fs1); fs1.Close(); } } #endregion }
//{
// row.Cells[i].CellStyle = style;
//}