/// <summary> /// 单元格区域 填充颜色 /// </summary> /// <param name="cell"></param> /// <param name="rgb"></param> public static void FillColor(this ISheet sheet, int beginRow, int beginCol, int endRow, int endCol, string rgb) { IWorkbook workBook = sheet.Workbook; for (var rowIndex = beginRow; rowIndex <= endRow; rowIndex++) { IRow row = sheet.GetRow(rowIndex); for (var colIndex = beginCol; colIndex <= endCol; colIndex++) { ICell cell = row.GetCell(colIndex); cell.FillColor(rgb); } } }