Is there any chance to enable UNDO/REDO with VBA workbook?
Thanks![]()
Is there any chance to enable UNDO/REDO with VBA workbook?
Thanks![]()
Your question is not very clear....do you mean perform a UNDO/REDO via code?
Please clairfy what you mean. Do you mean you wish to be able to undo changes made by a macro? If so, then you would need to make a macro that reverses the process. As far as I know, you cannot "undo" changes made by a macro by just clicking the Undo button. Another option would be to save your workbook before you run the code, and if you don't like what you get, close out without saving. If the macro includes a save command, then make a copy of the file before you run it. Or, even better, have the macro make a backup before it does anything else.
Various actions in Excel clear the undo/redo stack. Running a macro is one of them. I've seen a few attempts at creating custom undo functions but they can get pretty complex.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Hi guys,
I mean, like,
I have VBA codes on Auto_Open and some which depand on cell's value,
But when I change value of a cell that has nothing to do with VBA - I can't undo it.
Any help please?
Well, the code to Undo in VBA is:
, but you cannot undo several actions, only one. Running this command again would undo the undo (redo).![]()
Please Login or Register to view this content.
This probably means there is nothing to Undo. Either no action was done prior to the command, or that action was one of those actions that clears the Undo stack, like something done through VBA.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks