+ Reply to Thread
Results 1 to 5 of 5

Message Box for Duplicates

  1. #1
    Paul Black
    Guest

    Message Box for Duplicates

    Hi Everyone,

    I have a Column where Numbers are Entered. There can be from 5 Numbers
    to 200 or so Numbers. What I would like is to Check that there is NO
    Duplicates in the Column Please.

    Thanks in Advance.
    All the Best.
    Paul


  2. #2
    Dave Peterson
    Guest

    Re: Message Box for Duplicates

    =IF(COUNTA(A1:A200)=SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&"")),
    "all the same","not all the same")


    =SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&""))
    will give the count of unique items

    =count(a1:a200) will count the number of numbers.

    Paul Black wrote:
    >
    > Hi Everyone,
    >
    > I have a Column where Numbers are Entered. There can be from 5 Numbers
    > to 200 or so Numbers. What I would like is to Check that there is NO
    > Duplicates in the Column Please.
    >
    > Thanks in Advance.
    > All the Best.
    > Paul


    --

    Dave Peterson

  3. #3
    Paul Black
    Guest

    Re: Message Box for Duplicates

    Thanks Dave,

    How could I do it Using a Macro as well Please.

    Thanks in Advance.
    All the Best.
    Paul

    Dave Peterson wrote:
    > =IF(COUNTA(A1:A200)=SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&"")),
    > "all the same","not all the same")
    >
    >
    > =SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&""))
    > will give the count of unique items
    >
    > =count(a1:a200) will count the number of numbers.
    >
    > Paul Black wrote:
    > >
    > > Hi Everyone,
    > >
    > > I have a Column where Numbers are Entered. There can be from 5 Numbers
    > > to 200 or so Numbers. What I would like is to Check that there is NO
    > > Duplicates in the Column Please.
    > >
    > > Thanks in Advance.
    > > All the Best.
    > > Paul

    >
    > --
    >
    > Dave Peterson



  4. #4
    Bob Phillips
    Guest

    Re: Message Box for Duplicates

    Private Sub Worksheet_Change(ByVal Target As Range)

    On Error GoTo ws_exit
    Application.EnableEvents = False
    If Not Intersect(Columns(1), Target) Is Nothing Then
    If Application.CountIf(Columns(1), Target.Value) > 1 Then
    MsgBox Target.Value & " already exists"
    End If
    End If

    ws_exit:
    Application.EnableEvents = True
    End Sub

    This is worksheet event code, which means that it needs to be
    placed in the appropriate worksheet code module, not a standard
    code module. To do this, right-click on the sheet tab, select
    the View Code option from the menu, and paste the code in.


    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "Paul Black" <paul_black27@hotmail.com> wrote in message
    news:1139747863.241083.258850@g44g2000cwa.googlegroups.com...
    > Thanks Dave,
    >
    > How could I do it Using a Macro as well Please.
    >
    > Thanks in Advance.
    > All the Best.
    > Paul
    >
    > Dave Peterson wrote:
    > >

    =IF(COUNTA(A1:A200)=SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&"")),
    > > "all the same","not all the same")
    > >
    > >
    > > =SUMPRODUCT((A1:A200<>"")/COUNTIF(A1:A200,A1:A200&""))
    > > will give the count of unique items
    > >
    > > =count(a1:a200) will count the number of numbers.
    > >
    > > Paul Black wrote:
    > > >
    > > > Hi Everyone,
    > > >
    > > > I have a Column where Numbers are Entered. There can be from 5 Numbers
    > > > to 200 or so Numbers. What I would like is to Check that there is NO
    > > > Duplicates in the Column Please.
    > > >
    > > > Thanks in Advance.
    > > > All the Best.
    > > > Paul

    > >
    > > --
    > >
    > > Dave Peterson

    >




  5. #5
    Paul Black
    Guest

    Re: Message Box for Duplicates

    Excellent Bob.
    Thanks very much.
    All the Best.
    Paul


+ Reply to 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