+ Reply to Thread
Results 1 to 12 of 12

EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

  1. #1
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    Dear All

    Please help me to get out of the following Issue; I' have mentioned the detail in Simple way.

    I' am having a file in which some Macros are there.
    But whenever the Macros are getting Run, all Undo-History gets cleared and nothing remain to Undo.

    Example:
    If I' delete any Row / Column by mistake, I' am not able to Undo the same, as the Undo button gets disabled.

    -----------------------

    Searched on Net, but everywhere I' have got the following link as a solution
    http://www.j-walk.com/ss/excel/tips/tip23.htm

    But I' am not able to use the same.

    Any help on this will be appreciated

    Thanks
    MG

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    There is no getting out of it, other than using the code you found at the link.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    Thanks for reply,
    But I' am not able to use it, actually I' don't know how to use it in my file.

    Could you please help me with that?

  4. #4
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    Dear Experts

    I' am new to VBA and I' have mentioned my requirement above.

    But as I' found there are no response on this.

    Is there anyone who will guide me on how to use the code.

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

    Thanks
    MG

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    that code is not relevant to your needs-you have to write code to undo whatever it is your current code does
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    Hi JosephP

    It is not only the concern of what my code do?

    Because even if I' delete entire row, I' am not able to recover it.

    Atleast undo should work if user delete the entire row by mistake and try to recover.

    but here in my file the undo get disabled after deleting the rows.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    the only way-as the blog states-to undo what your code does is to write another routine that undoes it whether that be by reversing the code or creating a copy of the sheet that you can reinstate

  8. #8
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    I" am not able to do it

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    then live without it-that's what 99.76% of developers do :-)

  10. #10
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    Thanks for your Time

  11. #11
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    Hi Joseph

    Please can you give me solution for this Issue also.....

    It will be a great help

  12. #12
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: EXCEL: Prevent "Undo-History" After Macros / VBA Code Run

    just save a temp copy of it, and add an undo button where ever the Do button is to load this. Remember reloading a saved version will take your code back when using in test. I would add an extra line while developing to dump the code out to a file to.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1