Closed Thread
Results 1 to 6 of 6

Prevent Duplicate Entries

Hybrid View

whousedmy Prevent Duplicate Entries 05-08-2009, 01:22 AM
royUK Re: Prevent Duplicate Entries 05-08-2009, 02:28 AM
whousedmy Re: Prevent Duplicate Entries 05-08-2009, 03:38 AM
whousedmy Re: Prevent Duplicate... 05-13-2009, 09:40 PM
slash4u Re: Prevent Duplicate Entries 08-17-2010, 08:18 AM
royUK Re: Prevent Duplicate Entries 08-17-2010, 11:40 AM
  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Thumbs up Prevent Duplicate Entries

    Hi All,

    New here, I wanna do a "Prevent Duplicate Entries" into my column i try the following:
    1. http://www.mrexcel.com/articles/prev...duplicates.php
    2. http://www.theexceladdict.com/_t/t040818.htm

    They all work well but if I'm using copy and paste It doesn't work! why is tat so?

    Second issue will be i'm wanna do prevent duplication for the whole column not just one cell. Anyone can help with this 2 problem??

    Thanks alot in adv and for even reading!
    Last edited by whousedmy; 05-13-2009 at 11:24 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Prevent Duplicate Entries

    Copy & pasting overwrites the Data validation
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Prevent Duplicate Entries

    Quote Originally Posted by royUK View Post
    Copy & pasting overwrites the Data validation
    Thanks alot for your reply. So is there any other way or matter to get what I need?

  4. #4
    Registered User
    Join Date
    05-07-2009
    Location
    Singapore But in China now
    MS-Off Ver
    Excel 2007
    Posts
    25

    Talking Re: Prevent Duplicate Entries[SOLVED]

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r As Range
    Dim ans As String
    Const myCol As Long = 3
    If Intersect(Target, Columns(myCol)) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    For Each r In Intersect(Target, Columns(myCol))
    If Application.CountIf(Columns(myCol), r.Value) > 1 Then
    MsgBox (r.Value & " already exsists")
    r.ClearContents
    End If
    Next
    Application.EnableEvents = True
    End Sub
    Here the correct coding to solve duplicate entries in the same columns.
    Last edited by whousedmy; 05-13-2009 at 09:45 PM. Reason: SOLVED
    Noobie here to LEARN

  5. #5
    Registered User
    Join Date
    08-15-2010
    Location
    mumbai,india
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Prevent Duplicate Entries

    can u tell in detail how to do in excel 2003 , i mean where to enter the coding and everything...pleaseeeee i have the exact problem so please help me too

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Prevent Duplicate Entries

    Copy the Excel VBA code
    Select the workbook in which you want to use the code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
    Right-click on the ThisWorkbook object, and choose View Code
    Where the cursor is flashing, choose Edit | Paste

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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