Well, I managed to put together something workable. There are two functions: {INSDOWN}
and {DELUP}
that work like Excel's insert/delete with shifting cells down/up. You can do a whole range, and it will vacate/remove the cells across all the included rows and columns.
The two functions, {INSDOWN}
and {DELUP}
, take a range name as their sole argument. This can either be a range name (e.g. NEWROW
) or absolute addresses (e.g. A4..C8
).
There are also Alt-I and Alt-D macros that allow for interactive insertion/deletion. Move to a corner of the range, hit the macro hotkey to begin the range selection, move to the opposite corner, and hit Enter.
Make sure you don't use these macros to insert/delete cells located above the macros themselves, or things will get a bit weird. :)
Here's the macro text via print-to-file with the list cell formulas option (and a tiny bit of manual formatting for readability). Make sure you /rnlr
the stuff in column A to set up the appropriate range names.
A1: 'ROWNUM
A3: 'NEXTROWNUM
A5: 'STARTCOLNUM
A6: 'STARTCOL
B6: @IF(STARTCOLNUM>26,@CHAR(@INT(STARTCOLNUM/26)+64),"")&@CHAR(@MOD(STARTCOLNUM,26)+64)
A8: 'ENDCOLNUM
A9: 'ENDCOL
B9: @IF(ENDCOLNUM>26,@CHAR(@INT(ENDCOLNUM/26)+64),"")&@CHAR(@MOD(ENDCOLNUM,26)+64)
A11: 'INSRANGE
B11: 'INSPOINT
A13: 'SETUPINSRANGE
B13: '{PUT ROWNUM,0,0,@STRING(@CELL("row",@@(INSRANGE)),0)}
B14: '{PUT NEXTROWNUM,0,0,@STRING(@CELL("row",@@(INSRANGE))+@ROWS(@@(INSRANGE)),0)}
B15: '{PUT STARTCOLNUM,0,0,@CELL("col",@@(INSRANGE))}
B16: '{PUT ENDCOLNUM,0,0,@CELL("col",@@(INSRANGE))+@COLS(@@(INSRANGE))-1}
A18: 'INSDOWN
B18: '{DEFINE INSRANGE:S}
B19: '{SETUPINSRANGE}
B20: '{CALC}
B21: '/m{STARTCOL}{ROWNUM}..{ENDCOL}8192~
B22: '{STARTCOL}{NEXTROWNUM}~
A24: '\I
B24: '{ABS}{?}{woff}~
B25: '/rncINSPOINT~{ESC}
B26: '{INSDOWN INSPOINT}
B27: '/rndINSPOINT~{won}
A29: 'DELUP
B29: '{DEFINE INSRANGE:S}
B30: '{SETUPINSRANGE}
B31: '{CALC}
B32: '/m{STARTCOL}{NEXTROWNUM}..{ENDCOL}8192~
B33: '{STARTCOL}{ROWNUM}~
A35: '\D
B35: '{ABS}{?}{woff}~
B36: '/rncINSPOINT~{ESC}
B37: '{DELUP INSPOINT}
B38: '/rndINSPOINT~{won}
A40: 'woff
B40: '{WINDOWSOFF}{PANELOFF}
A42: 'won
B42: '{WINDOWSON}{PANELON}