View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Find Unique Entries

James

have a look at the Help for Advanced Filter.

You'll need Data | Filter | Advanced Filter... | Copy to another range |
Unique records only

In the dialogue box:
Copy to another location
List range: $R$1:$R$13
Criteria range: blank
Copy to: $S$1
Unique records only: tick

Should be VERY quick. No code required but you could record it if you want
a macro.

Regards

Trevor


"James Stephens" wrote in message
...
What I am trying to do I think is simple and what I have works but takes

along time - any advice on a faster way would be great

I have a bunch of data and I it is all dated - I set up in the last column

and get a value that is "mmyyyy", but each file may have more than one moths
worth of data so I copy and sort it and use the code below to delete the
duplicates so that in the end I get a list of all the unique "mmyyyy" values
there are. Then I take that and sort and send out to new files the
origional data based on date.

Sub GetFields112()
Application.Calculation = xlCalculationManual
Dim lastrow As Long, r As Long
lastrow = ActiveSheet.UsedRange.Rows.Count
For r = lastrow To 1 Step -1
If Cells(r, 17).Value = Cells(r + 1, 17) Then Rows(r).Delete
Next r
Application.Calculation = xlCalculationAutomatic
End Sub

What I need is a faster way to do this since a file may have many

thousands of entries, is there a way to basically say, look in column "R"
find all the unique values and then but them in column "S" starting in row
one and listing them down.

Any help would be great, what I have works but takes about 10 minutes to

run, and I am looking for a shorter way to do it.

Thanks,

Jim