+ Reply to Thread
Results 1 to 10 of 10

Delete duplications in row not column

  1. #1
    Registered User
    Join Date
    04-02-2011
    Location
    england
    MS-Off Ver
    Excel 2007, 2010
    Posts
    6

    Delete duplications in row not column

    Hope someone can help, I'm trying to work out a macro or some code that will delete duplicate entries in the row not column.

    example:

    Cell A Cell B Cell C Cell D
    1 YU2 ABH YU2 ABH YU2 ABH YU2 ABH
    2 abc 123 yorkshire boston abc123
    3 blean kent york dge 098
    4

    I want for instance cell D to retain the post code entry and the other entries to delete if they contain the same post code, else leave entry if value is different.

    Hope you can help. Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Delete duplications in row not column

    Hello stroudy,

    Welcome to the Fourm!

    There seems to be something missing. In the workbook there are only 3 columns while in your example there are 4 columns. I am guessing the workbook is correct. Can you advise me on which is correct?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-02-2011
    Location
    england
    MS-Off Ver
    Excel 2007, 2010
    Posts
    6

    Re: Delete duplications in row not column

    Quote Originally Posted by Leith Ross View Post
    Hello stroudy,

    Welcome to the Fourm!

    There seems to be something missing. In the workbook there are only 3 columns while in your example there are 4 columns. I am guessing the workbook is correct. Can you advise me on which is correct?

    Thanks The workbook is fine.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Delete duplications in row not column

    Hello stroudy,

    Just to be sure I understand, you want to delete any row that has a duplicate postcode, correct?

  5. #5
    Registered User
    Join Date
    04-02-2011
    Location
    england
    MS-Off Ver
    Excel 2007, 2010
    Posts
    6

    Re: Delete duplications in row not column

    No sorry I need it to be the cell or cells not rows

    sorry I'll do a better example


    CELL A CELL B CELL C
    1AS FJX CVF T56 CFR 67J < this row is fine.
    ASB FGH ASB FGH ASB FGH <Delete cell A AND B on this row not cell c
    123 456 ADS FGH 123 456 <Only delete cell A on this row.

  6. #6
    Registered User
    Join Date
    04-02-2011
    Location
    england
    MS-Off Ver
    Excel 2007, 2010
    Posts
    6

    Re: Delete duplications in row not column

    Please check example spreadsheet
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-02-2011
    Location
    england
    MS-Off Ver
    Excel 2007, 2010
    Posts
    6

    Re: Delete duplications in cell row not column

    Hi I need a code which will delete duplicates in cells in the same row.

    See attachment. thanks
    Attached Files Attached Files

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Delete duplications in row not column

    Hello stroudy,

    The macro below has been added to a button in the attached workbook. This will remove the duplicates in columns "A" and "B".
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-02-2011
    Location
    england
    MS-Off Ver
    Excel 2007, 2010
    Posts
    6

    Re: Delete duplications in row not column

    Hi Thanks very much for this,

    The macro works great but it only deletes the cells if they both are the same as the country. My fault due to explanation. I also need A2 =123 to delete as this matches country criteria.
    Thanks

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Delete duplications in row not column

    Hello stroudy,

    Please take your time and provide a sample workbook that accurately reflects the data and the layout. Include examples of the data showing both before and after results. This will ensure that you are provided with a complete and accurate solution.

+ 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