Consulting

Results 1 to 4 of 4

Thread: Solved: Undo & redo macro

  1. #1

    Solved: Undo & redo macro

    Hi

    What would an undo macro look like as well as an redo macro? I want to place them in two separate buttons in a worksheet.

    I know - I am very basic

  2. #2
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Who knows?, it will look like a reverse of your DO macro and redo will look like your DO macro.

    Excel already has the redo/undo feature built in but you cannot undo anything a macro does with this, so if you DO with a macro you have to remember what it did to undo it, or every time you DO with a macro save a hidden copy of the sheet then the undo would be to replace that sheet or content.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Quote Originally Posted by Simon Lloyd
    Who knows?, it will look like a reverse of your DO macro and redo will look like your DO macro.

    Excel already has the redo/undo feature built in but you cannot undo anything a macro does with this, so if you DO with a macro you have to remember what it did to undo it, or every time you DO with a macro save a hidden copy of the sheet then the undo would be to replace that sheet or content.

    Thanks! So there's no way of commanding "ctrl+z!" and "ctrl+y!" then with VBA?

  4. #4
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,005
    Location
    Not really and as i said if you used an UNDO button that runs a macro to undo you will have cleared the clipboard and not be able to REDO.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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