Here is a sample of what I meant.
study the data.
there are only three unique numbers in my list.#
Modify the list if you want
then run the macro.
Sub Macro1()
On Error Resume Next
'Copy column A into an array. Saves having lots of read commands
Sheets("New Data (2)").Select
myarray = Range("A1:A" & Range("A1").End(xlDown).Row).Value
'Loop through the ref numbers in your array
For Count = 1 To UBound(myarray)
IndexVal = myarray(Count, 1)
'Does your ref no exist in your list of numbers?
Sheets("Unique References").Select
Columns("A:A").Select
Selection.Find(What:=IndexVal, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
'If not then
If ActiveCell.Value <> IndexVal Then
'Add it to your list
Cells(Range("A1").End(xlDown).Row + 1, 1).Value = IndexVal
'Copy the entry to another sheet
With Sheets("Extracted Data")
NR = .Range("A1").End(xlDown).Row + 1
Sheets("New Data (2)").Range("A" & Count & ":G" & Count).Copy Destination:=.Range("A" & NR)
End With
End If
Next
End Sub
Bookmarks