Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Once a macro is run, can you "undo" it? Or, is there a second macro that will
reverse any previous macro just run? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, You'll have to take care of that yourself
-- Kind regards, Niek Otten "MissyLovesExcel" wrote in message ... Once a macro is run, can you "undo" it? Or, is there a second macro that will reverse any previous macro just run? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Missy,
See John Walkenbach's Undo notes at: http://www.j-walk.com/ss/excel/tips/tip23.htm --- Regards, Norman "MissyLovesExcel" wrote in message ... Once a macro is run, can you "undo" it? Or, is there a second macro that will reverse any previous macro just run? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nope. There is no Back button. Run is run and deleted is gone. You could
write something to reverse some actions but some actions are permanent. Be very careful what you write and prompt for any action that can not be undone. The undo button is also unavailable after the macro is run. You can use application.undo while a macro is running to undo the last action the last action performed. -- HTH... Jim Thomlinson "MissyLovesExcel" wrote: Once a macro is run, can you "undo" it? Or, is there a second macro that will reverse any previous macro just run? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Missy, you can't undo a macro, but you can revert the file to the state
it was before the macro was run with this code: Sub RevertFile() wkname = ActiveWorkbook.path & "\" & ActiveWorkbook.Name ActiveWorkbook.Close Savechanges:=False Workbooks.Open FileName:=wkname End Sub HTH Greg |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That would seem to fall apart if the macro contained a Save command. And
really it's no different than saving the file just before you run your macro, then closing without saving changes if you don't like the results. "GregR" wrote in message ups.com... Missy, you can't undo a macro, but you can revert the file to the state it was before the macro was run with this code: Sub RevertFile() wkname = ActiveWorkbook.path & "\" & ActiveWorkbook.Name ActiveWorkbook.Close Savechanges:=False Workbooks.Open FileName:=wkname End Sub HTH Greg |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ed, you are absolutely right, but if it doesn't contain a save command,
it is an alternative to recover the file. Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Undoing formula | Excel Discussion (Misc queries) | |||
undoing conditional formatting | Excel Discussion (Misc queries) | |||
Undoing LINKS in Excel 2000 | New Users to Excel | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming | |||
undoing a VB action | Excel Programming |