+ Reply to Thread
Results 1 to 9 of 9

Is there any chance to enable UNDO/REDO with VBA workbook?

  1. #1
    Registered User
    Join Date
    11-05-2010
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    32

    Is there any chance to enable UNDO/REDO with VBA workbook?

    Is there any chance to enable UNDO/REDO with VBA workbook?

    Thanks

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Your question is not very clear....do you mean perform a UNDO/REDO via code?

  3. #3
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Please clairfy what you mean. Do you mean you wish to be able to undo changes made by a macro? If so, then you would need to make a macro that reverses the process. As far as I know, you cannot "undo" changes made by a macro by just clicking the Undo button. Another option would be to save your workbook before you run the code, and if you don't like what you get, close out without saving. If the macro includes a save command, then make a copy of the file before you run it. Or, even better, have the macro make a backup before it does anything else.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Various actions in Excel clear the undo/redo stack. Running a macro is one of them. I've seen a few attempts at creating custom undo functions but they can get pretty complex.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  6. #6
    Registered User
    Join Date
    11-05-2010
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Hi guys,

    I mean, like,
    I have VBA codes on Auto_Open and some which depand on cell's value,

    But when I change value of a cell that has nothing to do with VBA - I can't undo it.



    Any help please?

  7. #7
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Well, the code to Undo in VBA is:
    Please Login or Register  to view this content.
    , but you cannot undo several actions, only one. Running this command again would undo the undo (redo).

  8. #8
    Registered User
    Join Date
    11-05-2010
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    Quote Originally Posted by Whizbang View Post
    Well, the code to Undo in VBA is:
    Please Login or Register  to view this content.
    , but you cannot undo several actions, only one. Running this command again would undo the undo (redo).
    Says: "Method 'Undo' of object '_application' failed"
    Err 1004

  9. #9
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Is there any chance to enable UNDO/REDO with VBA workbook?

    This probably means there is nothing to Undo. Either no action was done prior to the command, or that action was one of those actions that clears the Undo stack, like something done through VBA.

+ 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