Results 1 to 7 of 7

Application undo after a cell was moved

Threaded View

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Romania
    MS-Off Ver
    2010
    Posts
    16

    Application undo after a cell was moved

    Hello, I need help with this. I want to prevent cell A1 to be modified, and I use this code:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Not Intersect(Target, Range("A1")) Is Nothing Then
    Application.EnableEvents = False
    MsgBox "Denied"
    Application.Undo
    Application.EnableEvents = True
    Exit Sub
    End If
    
    End Sub
    This code works, but when I cut the cell A1 and paste it to another cell, the code does not work anymore. The cell A1 become clear and its value move to the cell I paste it.
    Last edited by Mike911; 05-25-2016 at 06:03 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 11-22-2014, 05:02 PM
  2. Application.Undo fails in a big VBA project
    By fadosolre in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2013, 10:05 AM
  3. EXCEL: Application.Undo Error
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2013, 01:22 AM
  4. Replies: 0
    Last Post: 02-29-2012, 01:40 PM
  5. Undo function to undo Visual Basic commands
    By pierre08 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2010, 04:59 AM
  6. [SOLVED] Application.Undo failing with specific order of events
    By Bill P in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2005, 03:05 PM
  7. Worksheet_Change and Application.undo
    By Mangesh Yadav in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2005, 08: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