NumberFormat of an entire column?

Hi,

Is it possible to set the NumberFormat of an entire column of cells instead of each cell individually?

Numbers Format

Thanks in adcance,

Rutger

Hi Rutger,

Yes, quite possible. Kindly refer to the following code:

Workbook objExcel = new Workbook();
Worksheet worksheet = objExcel.Worksheets[0];
Cells objCells = worksheet.Cells;
Style style = objExcel.Styles[objExcel.Styles.Add()];
//Set the currency format
style.Number = 6;
StyleFlag flag = new StyleFlag();
flag.NumberFormat = true;
//Format the second column.
objCells.Columns[1].ApplyStyle(style,flag);
objExcel.Save("d:\\test\\testnumformat.xls");
Thank you.

thanks for the quick reply!