Deleting all duplicate items in a list

tmitchel

New Member
Joined
Jul 24, 2007
Messages
8
I am a tax auditor, and I am working with excel and I have two lists. One is a complete list of items, both taxable and non-taxable, the other is a list of just non-taxable. I highlighted the non-taxable sales and copied and pasted them under the main list, and I want to delete all the non-taxable items. Basically, the only duplicates in my list are non-taxable, and I need to delete ALL of them. What is the best way for me to do this?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
That still leaves my non-taxable items in the list. All that does is delete one of the two duplicates
 
Upvote 0
There is nothing on the cpearson site that does what I need it to do.

An example of what I want is like this:

A
A
B
C
D
D
E
F
F
G

To end up like this:

B
C
E
G
 
Upvote 0
Thats why i sent you a link to Chips page:

Based on your example above using a formula from chips page:

if i use this formula =COUNTIF($B$2:$B$11,B2)>1 in conditional formatting and set the format to red (Or any colour)
I am left with BCEG as per your example?
 
Upvote 0
Can you expand further in that case?
Based on your example it worked for me?

Which ones doesnt it highlight? Can you post some of your actual data i can test with?
 
Upvote 0
Hello tmitchel, welcome to the board.
If you've no aversion to using a bit of vba for this (and assuming your list was in column A)
you might try something like this.
Code:
Sub DeleteDupes()
Dim LstRw As Long, iRng As Range, i As Range, DltRng As Range
LstRw = Cells(Rows.Count, "A").End(xlUp).Row
Set iRng = Range(Cells(1, "A"), Cells(LstRw, "A"))
For Each i In iRng
  If WorksheetFunction.CountIf(iRng, i) > 1 Then
    If DltRng Is Nothing Then
      Set DltRng = i
    Else
      Set DltRng = Union(DltRng, i)
    End If
  End If
Next i
If Not DltRng Is Nothing Then DltRng.Delete Shift:=xlUp
End Sub

Hope it helps.
 
Upvote 0
I figured it out, I used Chips method for sorting by cell colors, because I had one of the highlighted items bolded and red. Then I sorted so that the red items would have a duplicate above them. Then I used an If function to keep or delete the original item, deleted the ones I didn't want, then sorted again by color, and deleted the red ones. Thanks for your help!!
 
Upvote 0

Forum statistics

Threads
1,214,566
Messages
6,120,262
Members
448,953
Latest member
Dutchie_1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top