ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Go back to last step in programming (https://www.excelbanter.com/excel-programming/447199-go-back-last-step-programming.html)

TIMOTHY

Go back to last step in programming
 
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?

Auric__

Go back to last step in programming
 
TIMOTHY wrote:

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.

--
You left me incomplete, all alone as the memories still remain.

[email protected]

Go back to last step in programming
 
On Friday, September 21, 2012 11:09:33 PM UTC-4, TIMOTHY wrote:
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 open the saved copy.


All times are GMT +1. The time now is 07:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com