+ Reply to Thread
Results 1 to 12 of 12

data validation not working while we paste the values (for removing duplicates in a column

  1. #1
    Registered User
    Join Date
    01-21-2015
    Location
    hyderabad
    MS-Off Ver
    2007
    Posts
    73

    data validation not working while we paste the values (for removing duplicates in a column

    Hi,

    I put a data validation formula for removing duplicates in a column (ex: data validation formula is :- =countif(D:D,D1)<=1). While we entering values in D:D column, the formula is working. when we copy and paste the values in D:D column, data validation is not working. Pls help on this?

    Thank you in advance.

    Regards
    Ajay Pal
    Last edited by ajaypal.sp; 01-27-2015 at 02:54 PM.

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

    Re: data validation not working while we paste the values (for removing duplicates in a co

    What can I say? Don't Copy and Paste Special | Values into the Data Validated cells
    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
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: data validation not working while we paste the values (for removing duplicates in a co

    If it is just a matter of preserving the formatting then

    ctrl+V then tap ctrl then v

    But I imagine you don't want that because it side steps the data validation.
    If that is not what you want then what would you want/expect it to do when you ask it to paste a set of data that breaks the data validation rules?

  4. #4
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: data validation not working while we paste the values (for removing duplicates in a co

    I suppose you could then recheck the validation with a macro after pasting.

    Please Login or Register  to view this content.
    Last edited by scottiex; 01-27-2015 at 11:48 PM.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: data validation not working while we paste the values (for removing duplicates in a co

    1 of the short-comings of DV is that copy/paste can cause the DV rules to be ignored for that cell
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    01-21-2015
    Location
    hyderabad
    MS-Off Ver
    2007
    Posts
    73

    Re: data validation not working while we paste the values (for removing duplicates in a co

    Even I use copy & paste , then also data validation in cells has to work.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: data validation not working while we paste the values (for removing duplicates in a co

    Like I said, copy/paste makes DV not work

  8. #8
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: data validation not working while we paste the values (for removing duplicates in a co

    OK I put my idea in a sheet.

    Validation.xlsm.

    If you paste you should use the paste special of course.

    Two sheets one with buttons and one with a macro that runs on change.

  9. #9
    Registered User
    Join Date
    01-21-2015
    Location
    hyderabad
    MS-Off Ver
    2007
    Posts
    73

    Re: data validation not working while we paste the values (for removing duplicates in a co

    Hi,

    I didn't understand how did you wrote that Macro. Please explain the process.

  10. #10
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: data validation not working while we paste the values (for removing duplicates in a co

    I am not sure what you mean.

    Are you saying it is useful and want to know how to change it, or that you can't use it so you don't know ... or something else?

    You may want to provide more information (like a real example in use) to make sure we are on the same page if you want to get much further.

    Or you can consider the advise of the others here that data validation where people are pasting into the area might be the wrong solution. Maybe stepping back might give another more simple solution.

  11. #11
    Registered User
    Join Date
    01-21-2015
    Location
    hyderabad
    MS-Off Ver
    2007
    Posts
    73

    Re: data validation not working while we paste the values (for removing duplicates in a co

    Hi

    My question is very clear. Previously you send one attachment (Validation.xlsm), in that you wrote a macro using controls. I want to know that process (macro coding and overall process).

    thanks in advance.

  12. #12
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: data validation not working while we paste the values (for removing duplicates in a co

    Validation.xlsm

    Well I hope this helps.
    Almost every row of code commented and instructions on sheet.

    The Macros are in the sheet2 object(the on change macro) and the 2 modules.

    I just left the on change version of the macro to make it clear, and I added a reset to the validation so users don't need paste special (to make the instructions simple).

    But I didn't comment that one as it was just a straight recording of the action using a macro recorder.

+ 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. Sorting based on one column values and removing duplicates!
    By devpp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-26-2013, 09:41 AM
  2. [SOLVED] Removing Duplicates based on column values and criteria
    By viduran88 in forum Excel General
    Replies: 9
    Last Post: 04-04-2013, 11:37 AM
  3. Removing Duplicates in one column and summarizing data
    By guard23 in forum Excel General
    Replies: 5
    Last Post: 02-09-2012, 03:33 PM
  4. 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
  5. merge data from array without removing column duplicates
    By aversluis in forum Excel General
    Replies: 3
    Last Post: 09-26-2007, 12:48 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