public class Excelcell {public
static Boolean ismergedregion (Hssfsheet sheet,int row, int column)
{
int shee Tmergecount = Sheet.getnummergedregions ();
for (int i = 0; i < Sheetmergecount i++) {
Region CA = Sheet.getmergedregionat (i);
int firstcolumn = Ca.getcolumnfrom ();
int lastcolumn = Ca.getcolumnto ();
int firstrow = Ca.getrowfrom ();
int lastrow = Ca.getrowto ();
if (row >= firstrow && row <= lastrow)
{
if (column >= firstcolumn && column <= Lastco Lumn)
{return
true;
}
}} return false;
}
}
===============================================
RowNum = Sheet.getphysicalnumberofrows ();
for (int i = 7; i < rownum i++) {
row = Sheet.getrow (i);
if (excelcell.ismergedregion (sheet, Row.getrownum (), 1)) {
System.out.println ("merge cells, stop loops");
break;
try {
//Get Cell object
System.out.println (i+ "" +row.getcell (0) + "==>" +row.getcell (0). Getcellstyle (). Getindention () + "* * *" +row.getcell (1) + "" "+row.getcell (2));
} catch (Exception e) {
e.printstacktrace ();
}
}