View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Undo not working with macro

Hi John

A macro can do tons of dramatic stuff, like deleting tons of folders,
subfolders and files. An Undo library would have to bee just too huge to
have.

So you'll have to manually (aka write code for) register and save the macro
actions and also write an "undo" macro for this. Typically it would be to
save a copy of the workbook at the stage of macro start, and for Undo
replace the workbook with this backup copy. But it all depends what the
macro does. If it just changes a single cell, go for an easier solution.

HTH. Best wishes Harald

"jbchrist " skrev i melding
...
Hello!

I am creating a macro that modifies some data. I have just noticed
that the undo feature isn't available after I use my macro. (I can't
undo what my macro just did)

Is there a line of code that I have to include in my macro or
something??


Thanks
John


---
Message posted from http://www.ExcelForum.com/