+ Reply to Thread
Results 1 to 17 of 17

Find duplicates in colA in one sheet and write them in another sheet with row reference

  1. #1
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Find duplicates in colA in one sheet and write them in another sheet with row reference

    Hi

    I have a problem that im not able to solve. In col A in sheet 1 i have some data, number of rows will vary. If the data occurs more then one time i want to be informed about it in another sheet. I want to know which rows that are "infected" and the value in col A. Like this:


    sheet 1
    A
    1 490
    2 390
    3 700
    4 700
    5 700
    6 600

    Then in sheet 2:

    Rows Value
    3 700
    4 700
    5 700

    Hope someone can help me!

    /Masun

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    One way
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    Hi Masun,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    Trebor76, jindon!

    Thank you very much, it works great. Is there a way to separate the answer so that the row information will be put in one column and the value in a column next to it instead of getting the answer in one cell with both the row number and the value that is duplicated? Lets say it starts in E5 with the row number and in D5 the value. If that is possible it sure would be perfect!!

    /Masun

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    Did you actually try my code?

    Ahhh, I think I missed one protocol for TextToColumns.

    Adjusted to your need.
    Please Login or Register  to view this content.
    Last edited by jindon; 03-02-2013 at 09:35 AM.

  6. #6
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    jindon,

    Of course I did. It resulted with 1 in cell A1. In cell A2 the first information came wit first the row number (in my case 66) with some space to the value. (In my case 81642799). The next duplicate came in A3. (in my case row 434) It looked like this:
    1
    64 81642799
    434 81642799

    /Masun

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    Yeah, see my previous post. (edited)

  8. #8
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    jindon,

    I was writing mine while you edited yours. Its close to perfection now. ;-) I just wonder if there is a way to avoid to have the "1" above the answers? And now a new question popped up, what if there are no duplicates, what happens then?

    /Masun

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    "1" ?
    Can you post your file? Coz I can not replicate this.

    How do you want when No dups find?
    Currently it clears the destination and that's all.

  10. #10
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    jindon,

    If there are no duplicates a msgbox with that info would be nice, otherwise this is great if you just could avoid the "1" above the answers. See attached file.

    Thank you very much for your effort!

    /Masun
    Attached Files Attached Files

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    OK, you have blank row on the top.
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    jindo,

    Perfect!! Thank you very much!!

    /Masun

  13. #13
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    jindo,

    It seems i cheered a little bit to early, sorry for that...If I run the macro it finds the duplicates and place them correctly in the other sheet. But if i then remove the rows containing the duplicates and run the macro again it stops on this:

    With Sheets("Dublettkontroll").Range("d5").Resize(UBound(x) + 1)

    Could you please help me once again?

    /Masun

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    Again, I can not replicate....


    How did you remove the duplicates?

  15. #15
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    Hi,

    Sorry for not making any sense. After i run the macro the first time, which works, i know where the duplicates are (on which rows in sheet GrundData). After that i remove/delete the duplicates in sheet GrundData manually. Then i run the macro a second time, just for a test, and it is stoped. Have uploaded a new file with no duplicates in.

    Thanks so much for your effort in helping me!
    Attached Files Attached Files

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

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    OOps, sorry.
    It should be like this.
    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Find duplicates in colA in one sheet and write them in another sheet with row referenc

    jindo,

    Thank you very, very much! Perfect!!!

    /Masun

+ 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