![]() |
Cancel a macro already applied to all sheets
I found that I can not undo my macro operation by just clicking a button. Does anyone know how to cancel a macro action which is taken? -- minrufeng ------------------------------------------------------------------------ minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208 View this thread: http://www.excelforum.com/showthread...hreadid=515038 |
Cancel a macro already applied to all sheets
Unless the macro has an undo programmed into it (and most don't), you can close
the workbook without saving and then reopen. You'll lose any changes since the last save--including what the macro did. minrufeng wrote: I found that I can not undo my macro operation by just clicking a button. Does anyone know how to cancel a macro action which is taken? -- minrufeng ------------------------------------------------------------------------ minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208 View this thread: http://www.excelforum.com/showthread...hreadid=515038 -- Dave Peterson |
Cancel a macro already applied to all sheets
I've been trying to program an "undo" into a macro I wrote and I am having
trouble finding the resources. Is there an "undo" class/method or do I have to manually create an undo rountine. "Dave Peterson" wrote: Unless the macro has an undo programmed into it (and most don't), you can close the workbook without saving and then reopen. You'll lose any changes since the last save--including what the macro did. minrufeng wrote: I found that I can not undo my macro operation by just clicking a button. Does anyone know how to cancel a macro action which is taken? -- minrufeng ------------------------------------------------------------------------ minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208 View this thread: http://www.excelforum.com/showthread...hreadid=515038 -- Dave Peterson |
Cancel a macro already applied to all sheets
You have to keep track of the stuff you did and the stuff you want to be able to
undo. But macros can do lots that can't be undone. If you delete a file (not move to the recycle bin), if you format a disk, .... John Walkenbach explains it in his power programming books. And he shares that info (for free) at: http://www.j-walk.com/ss/excel/tips/tip23.htm Debra Dalgleish has a list of books at her site: http://www.contextures.com/xlbooks.html (including John's) Rayo K wrote: I've been trying to program an "undo" into a macro I wrote and I am having trouble finding the resources. Is there an "undo" class/method or do I have to manually create an undo rountine. "Dave Peterson" wrote: Unless the macro has an undo programmed into it (and most don't), you can close the workbook without saving and then reopen. You'll lose any changes since the last save--including what the macro did. minrufeng wrote: I found that I can not undo my macro operation by just clicking a button. Does anyone know how to cancel a macro action which is taken? -- minrufeng ------------------------------------------------------------------------ minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208 View this thread: http://www.excelforum.com/showthread...hreadid=515038 -- Dave Peterson -- Dave Peterson |
Cancel a macro already applied to all sheets
Can you "tell" Excel to execute the undo code when the user clicks "Undo" or
does it ahve to be a separately executed macro? "Dave Peterson" wrote: You have to keep track of the stuff you did and the stuff you want to be able to undo. But macros can do lots that can't be undone. If you delete a file (not move to the recycle bin), if you format a disk, .... John Walkenbach explains it in his power programming books. And he shares that info (for free) at: http://www.j-walk.com/ss/excel/tips/tip23.htm Debra Dalgleish has a list of books at her site: http://www.contextures.com/xlbooks.html (including John's) Rayo K wrote: I've been trying to program an "undo" into a macro I wrote and I am having trouble finding the resources. Is there an "undo" class/method or do I have to manually create an undo rountine. "Dave Peterson" wrote: Unless the macro has an undo programmed into it (and most don't), you can close the workbook without saving and then reopen. You'll lose any changes since the last save--including what the macro did. minrufeng wrote: I found that I can not undo my macro operation by just clicking a button. Does anyone know how to cancel a macro action which is taken? -- minrufeng ------------------------------------------------------------------------ minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208 View this thread: http://www.excelforum.com/showthread...hreadid=515038 -- Dave Peterson -- Dave Peterson |
Cancel a macro already applied to all sheets
You can tell excel what macro to use when the user hits the undo button.
That's what this line does: Application.OnUndo "Undo the ZeroRange macro", "UndoZero" (from John's sample code) Rayo K wrote: Can you "tell" Excel to execute the undo code when the user clicks "Undo" or does it ahve to be a separately executed macro? "Dave Peterson" wrote: You have to keep track of the stuff you did and the stuff you want to be able to undo. But macros can do lots that can't be undone. If you delete a file (not move to the recycle bin), if you format a disk, .... John Walkenbach explains it in his power programming books. And he shares that info (for free) at: http://www.j-walk.com/ss/excel/tips/tip23.htm Debra Dalgleish has a list of books at her site: http://www.contextures.com/xlbooks.html (including John's) Rayo K wrote: I've been trying to program an "undo" into a macro I wrote and I am having trouble finding the resources. Is there an "undo" class/method or do I have to manually create an undo rountine. "Dave Peterson" wrote: Unless the macro has an undo programmed into it (and most don't), you can close the workbook without saving and then reopen. You'll lose any changes since the last save--including what the macro did. minrufeng wrote: I found that I can not undo my macro operation by just clicking a button. Does anyone know how to cancel a macro action which is taken? -- minrufeng ------------------------------------------------------------------------ minrufeng's Profile: http://www.excelforum.com/member.php...o&userid=26208 View this thread: http://www.excelforum.com/showthread...hreadid=515038 -- Dave Peterson -- Dave Peterson -- Dave Peterson |
All times are GMT +1. The time now is 09:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com