Created attachment 22556 [details] Patch for shiftRows to update area references too HSSFSheet.shiftRows updates single references (A1) but leaves area references (A1:A4) intact. Patch fixing this attaced. I simply handled AreaPtg exactly the same way RefPtg was handled.
Fixed in svn r696038. This fix has added (hopefully complete) support for adjusting area refs due to row shifting. Formulas are now adjusted in every cell in the workbook (i.e current *and* all other sheets). However, other (non-cell) formulas such as defined names, data validation and conditional formats are not adjusted yet. This turned out to be more complex than expected. There are many permutations regarding the exact relation of the moved rows to the area ref in question, for example whether the moved rows initially overlap or end up overlapping the area ref, whether the overlap is complete or partial. JUnits were updated and added to cover this new functionality. The Ptg translation logic was moved into a separate class, 'FormulaShifter', to allow for easier testing and enhancement. This class could be augmented later to provide support for shifting columns, or perhaps any rectangular region. The Ptg adjusting logic should be easy to re-use for non-cell formulas if someone ever wants to write that patch.