• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Prevent Duplicated Entry in a Range

cyliyu

Member
Need help in VBA code or data validation will do?
How can I prevent a user from entering a duplicated entry in a range from C6 to J30?
The code if possible should consider a "space" in-between such as 0011 / 1920 and 011/1920. Thanks
 

Attachments

  • Sample.xlsb
    11 KB · Views: 5
Hi @herofox
Good idea, but this formula will not prevent the entry of other data if it is in the row above.
A little correction.
Code:
=COUNTIF($C$6:$J$306,C6)=1

Also, a solution via Data Validation will not solve the Copy/Paste problem.

Another idea is to highlight a cell via Conditional Formatting if the user enters a duplicate (or some VBA solution).
Code:
=AND(C6<>"",COUNTIF($C$6:$J$30,SUBSTITUTE(SUBSTITUTE(C6," /","/"),"/ ","/"))>1)
 

Attachments

  • cyliyu-navic43014.xlsx
    23.4 KB · Views: 6
Back
Top