Sorting out Duplicates

F

foolio

I have a price list with part numbers sorted on the left and price so
the right... The genius who wrote the price list doubled up on a whol
bunch of numbers. Is there a way to identify the duplicates ?

110204
110205
110206
110208
110208
110208
A-12322
B-12312
B-12312
B-12350
B-12367

Actually I know there is ... I have been using the following function
after sorting by part number...

A2 part number
B2 =if(a2=a1,true,false)
c2 =if(a2=a3,true,false)
d2 =if(or(b2=true,c2=true),true,false)

What that does is say true in the c column for dup part numbers....

What I am actually trying to do is make a macro because i get n numbe
of these part lists a day ..... anyways trying to make a macro tha
pastes that in the 2 row and then fills it down to the end of the pric
list (the length of the price list varies all the time of course)

Anyways thats what im looking for :p If someone can figure that ou
maybe i can take it a step farther and get the macro to automaticall
delete duplicate part numbers that have the same price
 
K

kkknie

This code starts at the bottom and deletes duplicates (keeping the las
one).

Code
-------------------
Sub DelDups()

Dim i As Long
Dim iFirstRow As Long
Dim sColumn As String
Dim sLastVal As String

sColumn = "A"
iFirstRow = 2

sLastVal = "XYZPDQ"

For i = Range(sColumn & "65536").End(xlUp).Row To iFirstRow Step -1
If Range(sColumn & i).Value = sLastVal Then Range("C" & i).EntireRow.Delete
sLastVal = Range(sColumn & i).Value
Next

End Su
 
F

foolio

That works perfectly to delete all the duplicates....unfortunatley that
not exactly what I am trying to do... I just want to identify th
duplicate OR delete duplicates that have the SAME price and identif
all the duplicates that are left after that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top