final PtgShifter shifter2007 = new PtgShifter(moveSheetIndex, startRow, endRow, nRow, startCol, endCol, nCol, SpreadsheetVersion.EXCEL2007);
for (Ref ref : all) {
final int tRow = ref.getTopRow();
final int lCol = ref.getLeftCol();
final Worksheet srcSheet = getSheet(sheet, ref.getOwnerSheet());
final Book srcBook = (Book) srcSheet.getWorkbook();
final Cell srcCell = getCell(srcSheet, tRow, lCol);
if (srcCell != null && srcCell.getCellType() == Cell.CELL_TYPE_FORMULA) {
final int sheetIndex = srcBook.getSheetIndex(srcSheet);
if (srcBook.getSpreadsheetVersion() == SpreadsheetVersion.EXCEL97) {
shiftHSSFFormulas(shifter97, sheetIndex, srcCell);
} else {
shiftXSSFFormulas(shifter2007, sheetIndex, (XSSFCell)srcCell, (XSSFWorkbook)srcBook);
}
}