Am I reading this right ?
You still want to delete the info that Person A enters if the part number is the same as what Person B entered somehwere above ?
(or does your worksheet just comprise a single column?)
Correct, I want to delete person B's data, because person A has already entered it. Multiple columns in the spread sheet. What I'm doing now is a data sort, highlighting all the columns, but the p/n column "A" is in ascending order. The duplicates appear on top of each other. I delete the repeats, then highlight the rest of the sheet by due date, which is in another column. This works for now, but takes time.
You may want to sort and do a subtotal or pivot table. Then select the visible cells (alt+semicolon), copy and paste into a new workbook.....The following may also be of use to you:
http://www.mrexcel.com/tip035.shtml
Check out method 2
On the basis that prevention is better than cure, you might want to consider using Data Validation in future so that duplicate entries in Column A cannot be made :-
Select Column A
Go to Data>Validation>Settings
Allow : Custom
Formula : =COUNTIF($A$1:$A1,A1)=1
Someone by the name of Jacob delivered this, as far as I know, it works...Place it in a standard module, where macros normally go...
Option Explicit
Sub DeleteDuplicates()
Application.ScreenUpdating = False
Dim x As Integer
Dim LastRow As Integer
Dim c As Range
Dim FirstAddress As String
Dim SearchValue As String
Dim Counter As Integer
LastRow = Range("A65536").End(xlUp).Row
For x = 1 To LastRow
SearchValue = Range("A" & x).Value
If SearchValue = "zzzdeletemezzz" Then
Else
With Range("A1:A" & LastRow)
Set c = .Find(what:=SearchValue, LookIn:=xlValues, lookat:=xlWhole)
FirstAddress = c.Address
Set c = .FindNext(c)
If c.Address = FirstAddress Then
Else
Range(c.Address).FormulaR1C1 = "zzzdeletemezzz"
Counter = Counter + 1
End If
End With
End If
Next x
x = 1
Do
If Range("A" & x).Value = "zzzdeletemezzz" Then
Rows(x).Delete
LastRow = LastRow - 1
Else
x = x + 1
End If
Loop While x < LastRow + 1
MsgBox (Counter & " duplicates have been deleted."), vbInformation, "Deletion Complete"
End Sub
Here's a better one ......
Better one :-
15415a.html
Or, if there are a lot of rows to be processed, this one might(or might not) be quicker :-
:- 15439.html