Tags: available, creating, excel, feature, macro, microsoft, modifies, msdn, software, undo, working

Undo not working with macro

On Microsoft » Microsoft Excel

3,880 words with 4 Comments; publish: Fri, 23 May 2008 07:01:00 GMT; (306125.00, « »)

Hello!

I am creating a macro that modifies some data. I have just notice

that the undo feature isn't available after I use my macro. (I can'

undo what my macro just did)

Is there a line of code that I have to include in my macro o

something' :confused:

Thanks

Joh

--

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

All Comments

Leave a comment...

  • 4 Comments
    • John

      not much you can do. Running a macro resets the Undo stack. I suppose, if

      you think about it, that's logical, as your macro could do an awful lot of

      things that might or might not need to be undone.

      Regards

      Trevor

      "jbchrist >" <<jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com> wrote in message

      news:jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com...

      > 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' :confused:

      >

      > Thanks

      > John

      >

      > --

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

      >

      #1; Fri, 23 May 2008 07:03:00 GMT
    • Hi John,

      See John Walkenbach's site notes:

      http://www.j-walk.com/ss/excel/tips/tip23.htm

      Regards,

      Norman

      "jbchrist >" <<jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com> wrote in message

      news:jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com...

      > 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' :confused:

      >

      > Thanks

      > John

      >

      > --

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

      >

      #2; Fri, 23 May 2008 07:04:00 GMT
    • 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 >" <<jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com> skrev i melding

      news:jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com...

      > 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' :confused:

      >

      > Thanks

      > John

      >

      > --

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

      >

      #3; Fri, 23 May 2008 07:05:00 GMT
    • Take a look here:

      http://j-walk.com/ss/excel/tips/tip23.htm

      In article <jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com>,

      jbchrist <<jbchrist.1aqdos.excel.todaysummary.com.excelforum-nospam.com>> wrote:

      > 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'

      #4; Fri, 23 May 2008 07:06:00 GMT