I am trying to write a macro which will re-set the inputbox default value to be the last value inputted, so if I type "2" in the inputbox below, the default will change to 2, for the next time the macro is run.
Only until the workbook I am running the macro on is closed, then the original default can be restored
(Excel 2007)
ROWSDOWN = InputBox("enter no.of rows DOWN to move the cells", "VerticalMove", _
-1) 'default -1 (=1 row up)
I have tried setting PREV_ROWSDOWN = ROWSDOWN
but my attempt (below) doesn't work: the next time I run the macro the inputbox default is 0. The value of PREV_ROWSDOWN (and ROWSDOWN) is lost when the macro ends?
ROWSDOWN = InputBox("enter no.of rows DOWN to move the cells (0=no change, - =move UP)", "VerticalMove", _
PREV_ROWSDOWN) 'should set default as value entered last time the macro run
PREV_ROWSDOWN = ROWSDOWN ''NW-not saved after macro finished, default changed to "0"
How can I achieve this?