Go back to last step in programming

  • Thread starter Thread starter TIMOTHY
  • Start date Start date
T

TIMOTHY

Dear all
we all know when we're working in excel normally by using ctrl+z we
can go to the last step. While using VBA i found we can't go back to
the last step,
whats your suggestion?
Always create a backup file?
 
TIMOTHY said:
we all know when we're working in excel normally by using ctrl+z we
can go to the last step. While using VBA i found we can't go back to
the last step,
whats your suggestion?
Always create a backup file?

Save before you run your macro. If you don't like the results, close without
saving and re-open.
 
Dear all

we all know when we're working in excel normally by using ctrl+z we

can go to the last step. While using VBA i found we can't go back to

the last step,

whats your suggestion?

Always create a backup file?

I assume this is for debug or for an incorrect user menu action.

If its a single worksheet issue, add a program line to copy the sheet before the action and provide a breakpoint or input to "undo" which, would then delete the now defective original sheet and rename the copy back to the original sheet name and loop back to the menu. If fact, for complicated sheet code development, my first macro code action would be to copy the original data sheet before continued modification so I can simply delete the sheet with bug issues. Also,I always keep my code in separate vb module(s) from the worksheets except for buttons which only call a module subroutine.

If a multisheet issue, have your code in a separate workbook and add a program line to copy the the target workbook before the action and provide the "undo" to close the defective workbook, delete it, rename the copy and openthe saved copy.
 
Back
Top