-1

So I have column A and column C. Both columns have duplicates. However I only want to delete based on the fact that there are duplicates if combined column A and column C have the same values.

Example:

Column A             Column B             Column C
Cool-1                 Def                  Story
Cool-1                 Def                  Story
Cool-1                 Def                  Movie
Cool-1                 Def                  Book

Cool-1 Def Story is essentially is the duplicate. How would I remove just those type of duplicates?

2
  • 1
    Welcome to SU! While we can and will help you with trouble you may be experiencing creating a macro, we're not a macro-writing service. Please include what you've tried/got already, and point out exactly where you're getting stuck. Aug 20, 2015 at 18:37
  • There is no mention of macro writing other that the VBA tag.
    – GeekyDaddy
    Aug 21, 2015 at 12:27

2 Answers 2

0

I just tried this in Excel 2010 and it works. I used a filter. You can get more information about filters using this link

Select the full table and click on data->Advanced(Sort & Filter). At the Advanced Filter window choose "Copy to another location". Select "Copy To" and put in a cell where you want the new data to copy to. Then select "Unique records only".

You will get a new table with all the records which are not duplicated

1

As a VBA reference, all of the following statements will perform the task:

Sub removeDuplicates()

    With ActiveSheet.UsedRange

        .removeDuplicates                           'duplicated rows based on all cols

        .removeDuplicates Columns:=Array(1, 2, 3)   'duplicates based on cols 1, 2, and 3

        .removeDuplicates Columns:=Array(3)         'duplicates in col 3

        .removeDuplicates Columns:=3                'duplicates in col 3

        .removeDuplicates Columns:=3, Header:=xlYes 'excludes header row

    End With

End Sub

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .