repeated info

O

One-Leg

Hello,

I have a document in which (under column A) I have different employees
UserID. The problem is that some of them are repeated many times... Since
the list includes about 6000 entries, I can't go one by one and delete the
ones that are repeated.

Is there a way to automatically go through the 6000 entries and delete the
ones that are repeated???

Thanks!!!
 
D

Dave Peterson

How about just keep the first occurance of each?

Add headers if you don't have them
select the range
data|filter|advanced filter
Check unique records only

You could even put that output into a different range by using the "copy to"
range box.

Or you could copy the visible rows where ever you want.
 
O

One-Leg

Hello!!!

I tried that and with the multiple steps I need to do after, I can't
complote my document... I really need to find a way (a VBA macro if needed)
to get Excel to go through the entire list and delete anything the is
repeated (and on;y keep one of them).

Example (Before)
============
A1: aa001234
A2: bb001234
A3: cc001234
A4: aa001234
A5: dd001234
A6: aa001234
A7: ee001234
A8: ff001234
A9: aa001234

Example (Before)
============
A1: aa001234
A2: bb001234
A3: cc001234
A4: dd001234
A5: ee001234
A6: ff001234
 
D

Dave Peterson

You only have one column of data??????

If yes, then maybe you could incorporate something like this in your code:

Option Explicit
Sub testme()
Dim myRng As Range

With Worksheets("Sheet1")
'add a header row
.Rows(1).Insert

'add a header
.Range("a1").Value = "HDR"

Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))

myRng.AdvancedFilter action:=xlFilterCopy, _
copytorange:=myRng.Cells(1).Offset(0, 1), unique:=True

'delete original data
.Columns(1).Delete

'delete header row
.Rows(1).Delete
End With
End Sub
 
Top