+ Reply to Thread
Results 1 to 5 of 5

Count duplicates,then remove them as they are entered

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Excel 2010
    Posts
    35

    Count duplicates,then remove them as they are entered

    I've got a InputBox set up ( its code here)
    It takes data i input and places it into columns A and B on sheet 2.

    Now,since the data i'm gonna be inputing is statistical,there will be duplicates.

    I need a code which would count how many times an entry has been repeated and then the number would be placed next to that entry,indicating the repeat number.
    Duplicates would be deleted.
    If an entry is not duplicated,it would have a number 1 next to it.

    So,an input data would be like:
    Data A
    Data B
    Data A
    Data A
    Data C
    Data C
    And the code would turn it into:
    Data A 3
    Data B 1
    Data C 2

    Now,the InputBox works by placing "Data" into column A, "A,B,C" into column B,so a 'counter' numbers need to be placed in column C.

    I beleive increment should be used,like i=1,i+1
    And i should use some way of entry being a sting,then comparing it with already entered data inside excel.
    Then,if there is a match,i+1 for specific entry gets processed,with that entry being "unentered(deleted)",and if there isnt a match,it enters data and assigns it a counter i=1

    Now,i can't put it into working VBA code(if that is the way to do it)

    Thanks in advance

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Count duplicates,then remove them as they are entered

    try
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Count duplicates,then remove them as they are entered

    You did it once more
    Just a quick followup,its not required but would be great if it could work too:
    Can the "comparer" be modified in a way so it's case free?
    Like "4evra" and "4EVRA" to be regarded as same entries,not different ones?

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Count duplicates,then remove them as they are entered

    add
    Please Login or Register  to view this content.
    somewhere above the first loop

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Count duplicates,then remove them as they are entered

    Thanks.
    Another problem solved fast thanks to your help.

+ 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