posted 17 years ago
I'm trying to format a column not a cell. The only way I can figure out how to format a column is by formating each individual cell; by implementing the code listed below. I would like to format a column instead of a row. I am able format a column in excel. I have hundreds/thousands of rows of data to format. Any suggestions would be very much appreciated.
Thanks, Lisa
HSSFCellStyle cellStyle = wb.createCellStyle();
HSSFDataFormat dataFormat = wb.createDataFormat();
cellStyle.setDataFormat(dataFormat.getFormat("0.00"));
HSSFRow row = sheet.createRow(iRow);
HSSFCell cell = row.createCell((short)1);
cell.setCellStyle(cellStyle);