+ Reply to Thread
Results 1 to 3 of 3

Disable CTRL-V in favor of another paste method

  1. #1
    Registered User
    Join Date
    01-05-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    43

    Disable CTRL-V in favor of another paste method

    Hello all.

    I have this code here that AlphaFrong kindly shared with me.

    Please Login or Register  to view this content.
    https://www.excelforum.com/excel-pro...ml#post5286089

    I am wondering because the sheet is password-protected, is it possible to disable the keyboard use of CTRL+V so that the only way to paste in this particular sheet would be to double click, as the macro above requires?

    If CTRL+V is used, maybe instead of the "This worksheet is password protected" pop-up message, the user will be asked to double click to paste?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Disable CTRL-V in favor of another paste method

    You could use Application.OnKey to map ^v to a do-nothing macro, e.g., Sub nuttin() : End Sub. However, cleverer users could use Application.OnKey to remove that mapping and revert to standard [Ctrl]+V functionality. There's no way to prevent a clever user from doing that. Thus, you'd be far better off using event handlers, specifically Worksheet_Change, to handle any paste operation the way you need it handled.

    Looking at your code, your worksheet is protected, so users can't paste into locked cells anyway. Pressing [Ctrl]+V should result in Excel displaying error dialogs telling users that cells are locked and the worksheet is protected. Since users can't use [Ctrl]+V anyway, what's the problem? If users would be pasting into unlocked cells, why does your BeforeDoubleClick event handler unprotect and reprotect the worksheet?

  3. #3
    Registered User
    Join Date
    01-05-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    43

    Re: Disable CTRL-V in favor of another paste method

    hrlngrv, thank you for the response.

    The data needs to get pasted in a specific way, at a specific column, so when macros run to sort the data, it doesn't create any issues, which is why the BeforeDoubleClick event handler unprotect and reprotect the worksheet.

    the macro itself works fine, the only reason I am looking to do this is to guard against users that don't bother to read the instructions before using the sheet.

+ 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. Disable Ctrl+A, Ctrl+C and Ctrl+V in Excel
    By wedzmer in forum Excel General
    Replies: 5
    Last Post: 05-10-2018, 03:59 AM
  2. Disable CTRL + C, V , X
    By Jack40 in forum Excel General
    Replies: 0
    Last Post: 02-04-2015, 07:37 AM
  3. Disable cut,copy,paste(including ctrl x, ctrl c n ctrl v)
    By Ramboexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2014, 01:00 AM
  4. How to disable CTRL+S shortcut
    By rudswa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2013, 07:50 PM
  5. how to disable ctrl c and ctrl v
    By slmi1313 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2011, 03:04 PM
  6. [SOLVED] Disable CTRL+D???
    By CMIConnie in forum Excel General
    Replies: 0
    Last Post: 02-09-2006, 03:55 PM
  7. [SOLVED] How to disable CTRL key
    By Bon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2005, 06:15 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