Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Undoing a macro

Once a macro is run, can you "undo" it? Or, is there a second macro that will
reverse any previous macro just run?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Undoing a macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Undoing a macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Undoing a macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Undoing a macro

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   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Undoing a macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Undoing a macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Undoing formula phil2006 Excel Discussion (Misc queries) 1 July 13th 06 11:33 AM
undoing conditional formatting lil'bit Excel Discussion (Misc queries) 3 November 10th 05 08:55 PM
Undoing LINKS in Excel 2000 jayceejay New Users to Excel 3 January 4th 05 05:58 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM
undoing a VB action RICH Excel Programming 2 November 14th 03 12:42 PM


All times are GMT +1. The time now is 09:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"