+ Reply to Thread
Results 1 to 7 of 7

Restrict Copy/Paste

  1. #1
    Registered User
    Join Date
    07-08-2009
    Location
    Hixson, TN, USA
    MS-Off Ver
    2010
    Posts
    20

    Restrict Copy/Paste

    Hi, Is there a way to prevent copy/pasting from one workbook into another, but allow copy/pasting within the workbook? This will be useful to check cheating by my students.

    Thanks, Dileep

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Restrict Copy/Paste

    Hi there,

    The Cheap 'n' Cheerful way to do this is to use the following code in the ThisWorkbook module, but it won't stop students from copying entire worksheets to another workbook:

    Please Login or Register  to view this content.

    Probably not as foolproof as you had hoped for, but it's getting late at this end!

    Hope this helps.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    07-08-2009
    Location
    Hixson, TN, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Restrict Copy/Paste

    Thank you Greg. This would prevent all copy/paste isn't? I would like the students to be able to copy/paste within the workbook they are working on, but prevented from doing so from some other workbook.

    Dileep

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Restrict Copy/Paste

    Hi again,

    Copy/Paste within the workbook itself is allowed, but the contents of the ClipBoard are cleared as soon as another workbook is activated.

    Regards,

    Greg M

  5. #5
    Registered User
    Join Date
    07-08-2009
    Location
    Hixson, TN, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Restrict Copy/Paste

    Thank you Greg, worked perfectly, initially I put the code in a module and it didn't do anything. Then I put it in the Worksheet and it worked. I appreciate your help.

    Dileep

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Restrict Copy/Paste

    Hi again Dileep,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Regarding:


    Then I put it in the Worksheet and it worked.


    The code should be put in the VBA CodeModule for ThisWorkbook rather than in the CodeModule for a Worksheet.


    Best regards,

    Greg M

  7. #7
    Registered User
    Join Date
    07-08-2009
    Location
    Hixson, TN, USA
    MS-Off Ver
    2010
    Posts
    20

    Re: Restrict Copy/Paste

    Hio Greg, I have a follow up question. I wanted to allow Copy/Paste to one or two sheets. So I tried the following code in the CodeModule of ThisWorkBook.

    HTML Code: 
    But it does not work. I put a MsgBox to see whether code is executed and it does. But the "Application.CutCopyMode = False" seems to have no effect. Would you please help?

    Thank you, Dileep

+ 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. How to restrict copy paste in drop down list?
    By chandan pawan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2016, 05:16 AM
  2. Restrict a copy/paste range that is already restricted
    By gaker10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2014, 10:05 AM
  3. Data validation - Restrict Copy paste
    By arunrajaiah in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2014, 10:24 AM
  4. Replies: 7
    Last Post: 07-04-2014, 05:34 AM
  5. How to restrict copy paste in drop down list?
    By Parwez in forum Excel General
    Replies: 5
    Last Post: 03-19-2013, 08:46 AM
  6. [SOLVED] To restrict copy and Paste in worksheet
    By flakedew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2012, 06:03 AM
  7. Restrict copy paste ability
    By wana be xl master in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2006, 03:30 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