final int lCol = ref.getLeftCol();
final int bRow = ref.getBottomRow();
final int rCol = ref.getRightCol();
final RefSheet refSheet = ref.getOwnerSheet();
final Worksheet sheet = BookHelper.getSheet(_sheet, refSheet);
final Workbook book = sheet.getWorkbook();
for(int row = tRow; row <= bRow; ++row) {
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);