+ Reply to Thread
Results 1 to 15 of 15

Prevent copy and paste invalid data for data validation cells

  1. #1
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Prevent copy and paste invalid data for data validation cells

    Hi,
    Highly appreciate your guidance and it's great. This time, I need to prevent copy and paste data for cells which are included data validation.
    It means, if cell is included drop down menu, it should be prevented to add other own values. it should be able to select only the drop down menu values. Though I added, error message with data validation function, it is allowed to copy and paste data for that cell.

  2. #2
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    Hope you will be respond for my question. Could you please help me to find the solution..

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Prevent copy and paste invalid data for data validation cells

    That is the weakness of data validation - it is the same as any other cell. You can paste anything into the cell.

    You could use VBA to prevent the user copying and pasting into data validation cells
    (I assume you want the user to be able to use copy and paste in other cells)
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    Though I add data validation error message with validation, user can copy and paste values for that validated cells. Therefore, I need to prevent copy and paste data for data validation cells.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Prevent copy and paste invalid data for data validation cells

    You are repeating what you have already told us.

    Do you want the user to be able to use copy and paste in other cells?
    Last edited by kev_; 12-19-2017 at 01:21 PM.

  6. #6
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    user to be able to copy and paste in cells which are not consisted with data validation drop down.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Prevent copy and paste invalid data for data validation cells

    If you allow paste on cells with data validation but without dropdown, then Excel overwrites data validation
    - do any of the cells have data validation without a dropdown?

    Edit:
    Just a thought ..
    - are data validation cells in specific columns (without other data)?
    - may be simpler to block paste in those specific columns
    Last edited by kev_; 12-20-2017 at 07:52 AM.

  8. #8
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    Thank you so much for your reply. Hope you can understand my issue by referring the attached excel sheet.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Prevent copy and paste invalid data for data validation cells

    Thank you for the workbook - I will look at it tomorrow

  10. #10
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    Thank you so much...

  11. #11
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Prevent copy and paste invalid data for data validation cells

    test in attached workbook
    data validation is in "yellow" cells

    this code prevents: user selecting E4:F4 \ {CTRL} c \ click on B4 \ {CTRL} v
    it does not prevent: user selecting E4:F4 \ {CTRL} c \ click on A4 \ {CTRL} v
    I will try find a simple solution for that

    in sheet module:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    Thank you sooo much...

  13. #13
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    But, in here, it can be copied the text and paste it to the selected cell.

    It means, when I copied only text and it can be pasted into selected cell.
    Last edited by inoka; 12-26-2017 at 04:55 AM.

  14. #14
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Prevent copy and paste invalid data for data validation cells

    Try more comprehensive solution in attached file

    Thanks to @xladept and @sintek for their suggestions - see this thread


    ThisWorkbook module:
    Please Login or Register  to view this content.
    SheetModule:
    Please Login or Register  to view this content.
    General Module:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kev_; 12-27-2017 at 08:24 AM.

  15. #15
    Forum Contributor
    Join Date
    12-11-2017
    Location
    Colombo
    MS-Off Ver
    2013
    Posts
    109

    Re: Prevent copy and paste invalid data for data validation cells

    Hi kev_,
    Thanks for your reply. It's great. But, I need to allow copy and paste only valid data. when pasting data over these data validation cells, it should be automatically clear all invalid data. And it should be remained only valid data.

+ 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. Prevent Copy Paste over Data Validation cell
    By mvel_sky in forum Excel General
    Replies: 18
    Last Post: 10-17-2016, 05:35 PM
  2. Data validation does not prevent invalid entries
    By DJvdW in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-29-2013, 11:34 AM
  3. prevent paste on cells with data validation
    By v2k2apj in forum Excel General
    Replies: 15
    Last Post: 08-22-2013, 11:14 AM
  4. VBA to prevent paste on data validation cells
    By v2k2apj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2013, 03:38 PM
  5. 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
  6. Prevent Copy Paste over Data Validation cell if it does not match?
    By Akime in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-04-2013, 02:07 PM
  7. Prevent Paste over Data Validation
    By dbodd in forum Excel General
    Replies: 16
    Last Post: 07-01-2011, 10:09 AM
  8. Prevent Copy/paste ruining data validation in shared workbook
    By owlie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2009, 12:28 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