JAVA poi 合并单元格
完整帮助代码:JAVA poi 帮助类
// 得到一个sheet中有多少个合并单元格 Integer sheetMergeCount = sheet.getNumMergedRegions(); for (Integer i = 0; i < sheetMergeCount; i++) { // 获取合并后的单元格 CellRangeAddress range = sheet.getMergedRegion(i); String cellValue = itemList.get(range.getFirstRow()).get(range.getFirstColumn()); for (Integer mRowIndex = range.getFirstRow(); mRowIndex <= range.getLastRow(); mRowIndex++) { for (Integer mColumnIndex = range.getFirstColumn(); mColumnIndex <= range.getLastColumn(); mColumnIndex++) { itemList.get(mRowIndex).set(mColumnIndex, cellValue); } } }