+ Reply to Thread
Results 1 to 12 of 12

VBA to find duplicate entries & move them

  1. #1
    Registered User
    Join Date
    06-22-2021
    Location
    Düsseldorf, Deutschland
    MS-Off Ver
    Office 365
    Posts
    6

    Question VBA to find duplicate entries & move them

    Hello,

    i have a Table with 10 titles. I need to find out the duplicated entries from one of the title in my example its (Anlagen ID). After i found out what the Duplicated entries are i have to take the entries from an other column and put it next to the first entry of the duplicated entries. After this I have to delete the duplicated rows. HOW_IT_HAS_TO_LOOK_LIKE.PNG
    Last edited by Yunus2929; 06-22-2021 at 04:50 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: VBA to find duplicate entries & move them

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: VBA to find duplicate entries & move them

    Formula

    AE2:
    =IF(AND(COUNTIF(A$2:A2,A2)=1,COUNTIF($A$2:$A$17,A2)>1),TEXTJOIN(", ",TRUE,IF(($A$2:$A$17=A2)*(ROW($A$2:$A$17)<>ROW(A2)),$K$2:$K$17,"")),"")

    copy down.

    If separate column then

    =IF(AND(COUNTIF(A$2:A2,A2)=1,COUNTIF($A$2:$A$17,A2)>1),TRANSPOSE(FILTER($K$2:$K$17,($A$2:$A$17=A2)*(ROW($A$2:$A$17)<>ROW(A2)),"")),"")
    Last edited by jindon; 06-22-2021 at 03:33 AM.

  4. #4
    Registered User
    Join Date
    06-22-2021
    Location
    Düsseldorf, Deutschland
    MS-Off Ver
    Office 365
    Posts
    6

    Re: VBA to find duplicate entries & move them

    Thank You,
    sorry for my bad englisch..

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: VBA to find duplicate entries & move them

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Registered User
    Join Date
    06-22-2021
    Location
    Düsseldorf, Deutschland
    MS-Off Ver
    Office 365
    Posts
    6

    Re: VBA to find duplicate entries & move them

    Unfortunately the problem is not solved yet. I try to solve it. i tried to copy the fomular but excel shows an error.

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

    Re: VBA to find duplicate entries & move them

    If you are using Office 365, it should work.

    Otherwise upload a workbook.

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.

  8. #8
    Registered User
    Join Date
    06-22-2021
    Location
    Düsseldorf, Deutschland
    MS-Off Ver
    Office 365
    Posts
    6

    Re: VBA to find duplicate entries & move them

    This is data
    Attached Images Attached Images
    Attached Files Attached Files

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

    Re: VBA to find duplicate entries & move them

    It doesn't work because your sheet layouts are different from the image in your opening post.

    Should be
    =IF(AND(COUNTIF(A$2:A2,A2)=1,COUNTIF($A$2:$A$870,A2)>1),TRANSPOSE(FILTER($E$2:$E$870,($A$2:$A$870=A2)*(ROW($A$2:$A$870)<>ROW(A2)),"")),"")

    However, since your list is a table, better vba.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-22-2021
    Location
    Düsseldorf, Deutschland
    MS-Off Ver
    Office 365
    Posts
    6

    Re: VBA to find duplicate entries & move them

    Thats awesome Thank You
    There is just one thing left. Is there any chance for example that after the Dahlienhof 7 it goes on with the Dahlienhof 9, Dahlienhof 13 and so on ?Unbenannt_LI.jpg
    Last edited by Yunus2929; 06-22-2021 at 04:47 AM.

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

    Re: VBA to find duplicate entries & move them

    OOps a typo...
    Please Login or Register  to view this content.
    should be
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-22-2021
    Location
    Düsseldorf, Deutschland
    MS-Off Ver
    Office 365
    Posts
    6

    Re: VBA to find duplicate entries & move them

    You are great man!!!! thanks a lot

+ 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] How to select filtered values and copy the results using makros
    By chablo309 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2015, 09:34 AM
  2. How to select filtered values and copy the results using makros
    By chablo309 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2015, 09:14 AM
  3. [SOLVED] Workbook makros to work in different excel versions
    By stojko89 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-16-2015, 09:36 AM
  4. Erneutes Ausfuehren des MAkros ueberschreibt alte Daten
    By svenjawei in forum Non English Excel
    Replies: 1
    Last Post: 05-30-2013, 01:05 PM
  5. How to make makros work properly when sheet is protected
    By Maiab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2012, 09:33 AM
  6. macro to disable makros
    By missing in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2006, 03:44 AM
  7. lots of makros into one makro??
    By JVLennox in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2006, 11:33 AM

Tags for this Thread

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