+ Reply to Thread
Results 1 to 3 of 3

Code for Last Operation

  1. #1
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    Code for Last Operation

    Hi,

    Anyone knows if there is a VBA code that identifies the last operation that was performed by a user in an Excel sheet? For instance if someone pasted ALL. Then I want to identify the operation "paste all" and undo the last operation by using Application.Undo inside the event Worksheet_Change().
    1. Reply to thread and inform if suggestion was helpful or not
    2. Click on the star (=Add Reputation) if you think someone helped you
    3. Mark [SOLVED] to this thread if solution was found. (On Menu "Thread Tools" > "Mark this thread as solved")

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,584

    Re: Code for Last Operation

    I very much doubt it. The worksheet change event handler responds to the fact that a change has been made to one or more cells. The Target identifies what has been changed but not how it came to be changed. And the Undo operation undoes the last change, and only the last change.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Code for Last Operation

    .
    I really enjoy reviewing the questions posted on this FORUM. Inevitably, the unassuming questions result in a wonderful learning experience for me !

    Joakim N ... THANK YOU for you question.

    Now ... this may not be the end all you were seeking but it does answer your example question. Paste the following into the Sheet Level Module :

    Please Login or Register  to view this content.
    Presently, the above macro only provides a MsgBox notification that a 'PASTE' occurred. You can add to the code to allow for logging info related to the paste.
    Last edited by Logit; 03-24-2018 at 12:29 PM.

+ 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] Amend existing code with New Operation
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2016, 06:03 PM
  2. VBA code to display a message when Filtered range is empty and skip the operation
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2015, 04:53 AM
  3. [SOLVED] Code limits its operation
    By carapins in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2013, 02:12 AM
  4. Time difference based on day of operation and time of operation
    By Guest79 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-18-2013, 04:28 AM
  5. Replies: 0
    Last Post: 10-11-2012, 11:30 AM
  6. *-- Operation
    By emricki in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-27-2011, 03:47 AM
  7. [SOLVED] what does $ operation mean
    By JO in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-15-2005, 08:45 PM

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