+ Reply to Thread
Results 1 to 6 of 6

Select from a Data Validation Menu whilst preventing Pasting

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Select from a Data Validation Menu whilst preventing Pasting

    I found this code on the forum which prevents the user from pasting into a cell which contains a Data Validation List:

    Please Login or Register  to view this content.
    The problem I have is that with this enabled, whilst it successfully prevents the user from pasting into the cell, it also prevents the user from selecting an option from the drop down list (created using Data Validation and the List Option). Is there any way to adapt the code to achieve the same thing but still allow the user to select an option from the data validation drop down list?

    Many thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select from a Data Validation Menu whilst preventing Pasting

    Maybe this:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Select from a Data Validation Menu whilst preventing Pasting

    Hi JBeaucaire,

    That does the trick, many thanks. If I want to keep the 'message' when they attempt to paste anything, how would I do that? I tried:

    Please Login or Register  to view this content.
    but that activates the message when the cell is clikced on, rather than when the user attempts to paste to the cell itself. Apologies, my VBA is very limited.

    Many thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select from a Data Validation Menu whilst preventing Pasting

    Please Login or Register  to view this content.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  5. #5
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Select from a Data Validation Menu whilst preventing Pasting

    Hi JBeaucaire,

    That does the trick...

    Many thanks for your help, much appreciated.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select from a Data Validation Menu whilst preventing Pasting

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 1
    Last Post: 07-10-2012, 05:16 AM
  2. Replies: 3
    Last Post: 12-10-2009, 09:30 PM
  3. Replies: 2
    Last Post: 05-04-2006, 02:40 PM
  4. Data Validation not preventing invalid entries
    By Denise in forum Excel General
    Replies: 2
    Last Post: 04-06-2006, 06:00 PM
  5. Replies: 2
    Last Post: 11-28-2005, 08:40 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