HSSFRow row1 = sheet1.getRow(j);
HSSFRow row2 = sheet2.getRow(j);
// check if the rows are not null
if(row1 != null && row2 != null) {
Iterator it1 = row1.cellIterator();
Iterator it2 = row2.cellIterator();
while(it1.hasNext() && it2.hasNext()) {
HSSFCell cell1 = (HSSFCell) it1.next();
HSSFCell cell2 = (HSSFCell) it2.next();
if(cell1 != null && cell2 != null) {
HSSFCellStyle cell1Style = cell1.getCellStyle();