+ Reply to Thread
Results 1 to 9 of 9

Removing rows that contain duplicate information in 3 columns

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Removing rows that contain duplicate information in 3 columns

    Hi,

    I have been unable to find the code that removes the rows with duplicate information in 3 columns that will work with excel 2003.

    I have attached an example with the second sheet showing results required.

    Any help appreciated.

    Thanks,

    David
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Removing rows that contain duplicate information in 3 columns

    i'm not sure about 2003... but this seems to be working in 2010...

    Please Login or Register  to view this content.
    hope it helps...

    (assuming the three columns you're wanting to check are E, F and G... if that is incorrect it's an easy fix.)
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Removing rows that contain duplicate information in 3 columns

    Please let us know the columns which needs to be considered for duplicate check


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Removing rows that contain duplicate information in 3 columns

    Thats perfect Thanks

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Removing rows that contain duplicate information in 3 columns

    Sorry Sixthsense for not making that clear, it was columns E, F and G

    The VBA provided by simarui worked great.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Removing rows that contain duplicate information in 3 columns

    Quote Originally Posted by djfscouse View Post
    Sorry Sixthsense for not making that clear, it was columns E, F and G
    Glad you got the solution and thanks for the brief

  7. #7
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Removing rows that contain duplicate information in 3 columns

    Upon further testing I just found out that it delete all rows if duplicates in column E are found which is not what I wanted, only delete rows that columns E, F and G are duplicated.

    Could anybody look at this for me.

    Maybe I should open a new post, please advise if so?

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Removing rows that contain duplicate information in 3 columns

    I have got the same output by using Excel's remove duplicates function. I know this function a bit corky. Just select columns E,F and G.

  9. #9
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Removing rows that contain duplicate information in 3 columns

    my bad,

    my code is not actually checking the same row in which the duplicate E value is found, so basically if E F and G are all found somewhere else in the dataset (not necessarily on the same row...) then the row is deleted... that really isn't what you're looking for, and to do so would require a loop through a findall function which i've used a few times (found here http://www.cpearson.com/excel/findall.aspx)

    but, much more simply, AB33 is correct. if you want that in vba for some reason this oughta work:
    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. Removing duplicate rows using only a few columns.
    By HorribleZane13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-27-2015, 09:34 AM
  2. [SOLVED] Removing duplicate columns
    By Rec1ne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2013, 06:04 PM
  3. Replies: 2
    Last Post: 12-26-2012, 05:15 PM
  4. Removing Duplicate Rows based on 2 columns
    By metalpoker in forum Excel Programming / VBA / Macros
    Replies: 37
    Last Post: 10-14-2011, 05:28 AM
  5. Replies: 1
    Last Post: 04-01-2005, 07:06 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