for (int col = lCol; col <= rCol; ++col) {
final Cell cell = BookHelper.getCell(sheet, row, col);
final CellStyle style = cell != null ? cell.getCellStyle() : null;
final String oldFormat = style != null ? style.getDataFormatString() : null;
if (oldFormat == null || "General".equals(oldFormat)) {
CellStyle newCellStyle = book.createCellStyle();
if (style != null) {
newCellStyle.cloneStyleFrom(style);
}
BookHelper.setDataFormat(book, newCellStyle, formatString); //prepare a DataFormat with the specified formatString
BookHelper.setCellStyle(sheet, row, col, row, col, newCellStyle);