+ Reply to Thread
Results 1 to 8 of 8

vba to prevent copy paste, drag and right click on one or multiple columns

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    84

    vba to prevent copy paste, drag and right click on one or multiple columns

    what is the vba (not using protect sheet) to prevent copy paste, drag and right click to one column only - say, column A.
    or maybe a set of columns range A:E
    many thanks

  2. #2
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    this will do, go to your worksheet events:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-20-2018
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    thank you for your reply.
    the codes you posted prevents copy paste to the whole worksheet.
    what I am requesting is to prevent only on a certain column or range of columns - not the whole worksheet.
    many thanks..

  4. #4
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    oops, my bad. maybe this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-20-2018
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    thank you for the reply.
    the code is preventing data entry.
    it should allow input of data but not copy paste.
    sorry I might have missed it in the OP.
    many thanks..

  6. #6
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    sorry this is better:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-20-2018
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    splendid!!!
    it worked very nicely.
    many many thanks..

    I think this should also prevent DRAG.

    Please Login or Register  to view this content.
    Last edited by LFKim2018; 10-15-2018 at 04:17 AM.

  8. #8
    Registered User
    Join Date
    07-20-2018
    Location
    Quezon City, Philippines
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: vba to prevent copy paste, drag and right click on one or multiple columns

    thank you very very much...

    sorry - spoke too soon.
    the code I inserted - it is preventing the DRAG beyond the 4th column - as a matter of fact - to the whole worksheet!
    how can we control this for up to the 4th column (D) only?
    again - many thanks..
    Last edited by LFKim2018; 10-15-2018 at 04:25 AM.

+ 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. Replies: 0
    Last Post: 10-05-2015, 12:07 PM
  2. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  3. Replies: 6
    Last Post: 07-27-2013, 09:02 AM
  4. [SOLVED] Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sheet2
    By babbeleme1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2013, 12:55 AM
  5. Replies: 1
    Last Post: 04-05-2013, 12:28 PM
  6. Prevent copy paste over data validation in multiple columns
    By vivek_83anands in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2013, 01:15 PM
  7. Replies: 2
    Last Post: 07-13-2012, 03:21 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