how do you style a whole worksheet before enter data.
For example, I would like to use the font 'Arial Narrow' for the whole worksheet, or paint every cell background with grey. There doesn't seem to be a way to do it.
Thanks for your help.
......
Worksheet worksheet = workbook.Worksheets[0];
//set background color for cells from A1 to H10
worksheet.Range["A1:H10"].Style.Color = Color.Gray;
//set font for cells from A1 to H10
worksheet.Range["A1:H10"].Style.Font.FontName = "Arial Narrow";
......
Worksheet worksheet = workbook.Worksheets[0];
//set background color for used cell range
worksheet.AllocatedRange.Style.Color = Color.Gray;
//set font for used cell range
worksheet.AllocatedRange.Style.Font.FontName = "Arial Narrow";
......
CellStyle style = book.Styles.add("newStyle");
style.Color = Color.Pink;
style.Font.Size = 15;
book.Worksheets[0].ApplyStyle(style);
......
//style the used cell range
sheet.AllocatedRange.Style.Color = Color.Red;
sheet.AllocatedRange.Style.Font.FontName = "Arial";
//add color to the first row of the used range
sheet.AllocatedRange.Rows[0].Style.Color = Color.Blue;