+ Reply to Thread
Results 1 to 4 of 4

Identification of duplicates numbers in a column and print as duplicates with that number

  1. #1
    Registered User
    Join Date
    10-12-2017
    Location
    india
    MS-Off Ver
    windows 7
    Posts
    10

    Identification of duplicates numbers in a column and print as duplicates with that number

    Sir, I tried a small macro but unable to get the result. I have a data file with numbers in a column in which some numbers are duplicated. I need the result column to identify the duplicates and display them with that number and text as duplicate. Given the data file below.


    INPUT
    1
    2
    3
    1
    4
    5
    6
    7
    8
    4
    7
    9
    8
    10
    11
    8

    RESULT
    1 duplicate

    1 duplicate

    4 duplicate


    7 duplicate
    8 duplicate
    4 duplicate
    7 duplicate

    8 duplicate


    8 duplicate



    -------------------




    Sub TEST()
    Dim lastRow As Long

    Dim matchFoundIndex As Long
    Dim iCntr As Long


    lastRow = Range("A65000").End(xlUp).Row

    For iCntr = 1 To lastRow


    If Cells(iCntr, 1) <> "" Then

    matchFoundIndex = WorksheetFunction.Match(Cells(iCntr, 1), Range("A1:A" & lastRow), 0)
    If iCntr <> matchFoundIndex Then
    Cells(iCntr, 2) = "Duplicate"

    End If

    End If
    Last edited by kswapnadevi; 10-16-2017 at 02:21 AM.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Identification of duplicates numbers in a column and print as duplicates with that num

    Hi
    this user-defined function returns the number of times a particular number is duplicated in the specified range

    Please Login or Register  to view this content.
    for example, if the numbers in your post are in cells A1:A16 then

    =IsDup(A16,A$1:$A$16)

    yields

    2 duplicates

    (i.e. there are 2 other instances of the number 8 in your list)

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Identification of duplicates numbers in a column and print as duplicates with that num

    Try this one.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Identification of duplicates numbers in a column and print as duplicates with that num

    Please Login or Register  to view this content.

+ 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. [SOLVED] Add up quantitites in Column E based on duplicates in Column A, then delete duplicates
    By eli-vergara in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2016, 05:44 PM
  2. Number ranking - auto-adjust numbers so there's no duplicates
    By Sheeela in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 11:06 AM
  3. [SOLVED] Find duplicates in column A, add values from column B (possibly delete duplicates)
    By luarwhite in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2013, 04:34 PM
  4. [SOLVED] Find duplicates, concatenate into different column, sum and delete duplicates
    By rosannang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 11:23 AM
  5. Replies: 3
    Last Post: 03-09-2011, 07:00 PM
  6. count the number of duplicates and print the number of occurences
    By ash81sen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2010, 01:21 PM
  7. [SOLVED] Searching for Duplicates across columns and print to new column
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2005, 02:05 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