Exemplo n.º 1
0
 /**
  * 指定セルの削除
  *
  * @param sheet シート
  * @param startRow 開始行番号
  * @param endRow 終了行番号
  * @param startColumn 開始列番号
  * @param endColumn 終了列番号
  */
 public static void removeCell(
     XSSFSheet sheet, int startRow, int endRow, int startColumn, int endColumn) {
   assert sheet != null;
   for (int nRow = startRow; nRow <= endRow; nRow++) {
     XSSFRow row = sheet.getRow(nRow);
     if (row != null) {
       for (int nColumn = startColumn; nColumn <= endColumn; nColumn++) {
         XSSFCell cell = row.getCell(nColumn);
         if (cell != null) {
           row.removeCell(cell);
         }
       }
     }
   }
 }