+ Reply to Thread
Results 1 to 8 of 8

Data validation not working on paste

  1. #1
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Data validation not working on paste

    Hi,

    At work we have a spreadsheet with many client's information in it. I have turned on data validation to check for duplicate entries, and it works very well...when someone types in a name. However if they paste it in, it never goes through the validation.

    How can I get the entries validated after a paste operation?

    Thanks

  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,373

    Re: Data validation not working on paste

    The copied cell replaces the target cell, completely overwriting it, hence removing the Data Validation.

    You'd need VBA to monitor and repair such damage. Might be better to use VBA full stop .

    Regards, TMS
    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
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Re: Data validation not working on paste

    Ok, and what would that VBA look like? I'm not even sure where to start.

    Thanks for your help!

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data validation not working on paste

    Pasting defeats Data Validation.
    There is VBA code at this URL to prevent COPY AND PASTING, DRAG AND DROP http://www.mrexcel.com/forum/excel-q...ste-excel.html
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Re: Data validation not working on paste

    I don't want to prevent pasting, as pasting is a good thing that reduces typo's and entry errors in this case. I would like something to run on range change, to check for duplicates, and let the user know there is now a duplicate/highlight which one is duplicate kinda thing

  6. #6
    Registered User
    Join Date
    10-26-2015
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    36

    Re: Data validation not working on paste

    Hi, I use something that checks if the same code is already in a line, and copy's the ones that don't exist, if you change it a bit (vba and sheet) it might do what you want. example.xlsm

    It checks the booking line on the new shipping tab and inserts it in the other named tab (self explanatory actually) just mess with it a bit and you'll find out how it works. it also removes the pasted data so you have an empty sheet again

    Hope it helps
    Thinking outside of the box by drawing circles.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Data validation not working on paste

    You could use Conditional formatting to flag duplicates as they occur. Select the cells with the Data Validation then in Conditional Formatting, New Rule, Format only Unique or Duplicate Values, select Unique and then apply the formatting of your choice

  8. #8
    Registered User
    Join Date
    02-19-2015
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    22

    Re: Data validation not working on paste

    Hi All,

    This is what I've got so far
    Please Login or Register  to view this content.
    It detects a change in column A, and checks if there is a duplication. If there is, then run Duplicate Identify and Duplicate Notify, else it just ends.

    It seems to work fine, but I have a problem of "Type Mismatch" with line "If Application.WorksheetFunction.CountIf("A:A", 1) Then"

    Any help is greatly appreciated!

+ 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. Data Validation Not Working
    By SMIengineering in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2015, 01:33 PM
  2. Replies: 11
    Last Post: 02-05-2015, 07:13 PM
  3. Data Validation not working,for excel validation Please Help!!!
    By angelmama in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-09-2014, 10:06 AM
  4. [SOLVED] Validation Data Not Working
    By cychua in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2013, 05:40 AM
  5. Data Validation not working with Copy and Paste
    By Quagga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-24-2010, 02:03 PM
  6. validation rules not working when someone copy paste data on validation cell
    By jthakrar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-17-2010, 03:36 AM
  7. [SOLVED] Data Validation Not Working
    By Brett in forum Excel General
    Replies: 6
    Last Post: 03-19-2005, 10:06 AM

Tags for this Thread

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