+ Reply to Thread
Results 1 to 4 of 4

Application.EnableEvents and Undo

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    seattle
    MS-Off Ver
    Excel 2007
    Posts
    22

    Application.EnableEvents and Undo

    In my attached worksheet, I have code (copied from some thread somewhere) that does just what I want, except that Undo doesn't work any longer.

    I think Application.EnableEvents=False is the culprit.

    Is there a simple way around this?

    The only thing I can think of is to capture the Undo Event, and then figure out how to programmatically Undo what the user just did.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Application.EnableEvents and Undo

    Running any code will 'cancel' Undo.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Application.EnableEvents and Undo

    When VBA writes to the same sheet, it cancels the undo. One way around that is to log the time values to another sheet.

    Please Login or Register  to view this content.
    If you want to have the time value show in the original sheet as well, put a formula like this in Cell H1 and copy down and across. Format H1 as Date-time
    =IF(Sheet2!A1="","",Sheet2!A1)
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    01-28-2014
    Location
    seattle
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Application.EnableEvents and Undo

    Thank you. That worked great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Application.EnableEvents and Application.ScreenUpdating
    By mcmunoz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-01-2013, 10:24 PM
  2. application.EnableEvents value changing to false
    By oosterhg in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-18-2012, 12:21 PM
  3. application.enableevents
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2011, 07:09 PM
  4. Application.EnableEvents disabled :-(
    By Jollyfrog in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-28-2010, 07:14 AM
  5. Application.EnableEvents Changes to False
    By Rushti in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-30-2009, 10:53 AM
  6. Application.EnableEvents
    By ilovedurango in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2007, 01:19 PM
  7. Application.EnableEvents help
    By Alex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2006, 02:00 PM
  8. application.EnableEvents
    By nc in forum Excel General
    Replies: 1
    Last Post: 09-28-2005, 11:05 AM

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