Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ticephotos
 
Posts: n/a
Default Deleting duplicate entries in an Excel list

I work with a list of about 3500 entries in Excel that is updated every 2
weeks. Is there any way to easily delete out duplicate entries without
manually sorting the list and deleting them one at a time?
  #2   Report Post  
Nick
 
Posts: n/a
Default

There are a couple of ways to do this.
One is using VB and a procedure to delete duplicate items.
Or you could use Data- Filter- Advanced Filter
By selecting the Select Unique Records only and copying to another range you
will get a list of non-duplicate items.

Nick


"ticephotos" wrote in message
...
I work with a list of about 3500 entries in Excel that is updated every 2
weeks. Is there any way to easily delete out duplicate entries without
manually sorting the list and deleting them one at a time?



  #3   Report Post  
ticephotos
 
Posts: n/a
Default

I tried the filter and still had almost all of the duplicate entries. How
would I write the code in VB to delete the duplicates?

"Nick" wrote:

There are a couple of ways to do this.
One is using VB and a procedure to delete duplicate items.
Or you could use Data- Filter- Advanced Filter
By selecting the Select Unique Records only and copying to another range you
will get a list of non-duplicate items.

Nick


"ticephotos" wrote in message
...
I work with a list of about 3500 entries in Excel that is updated every 2
weeks. Is there any way to easily delete out duplicate entries without
manually sorting the list and deleting them one at a time?




  #4   Report Post  
Nick
 
Posts: n/a
Default

Sub DeleteDups

Dim rInput as range
Dim rNext as range


Set rInput = ActiveCell (Assuming the Cell Selected is the start of your
list and contains the duplicate values)

rInput.Sort key1:=rInput.range

Do until isempty(rinput.value)
set rNext = rInput.Offset(1)
if rInput.Value=rNext.Value then
rInput.Entirerow.Delete
end if
set rInput = rNext
Loop


End Sub

I have tested this actual code put I know this works if I haven't made any
stupid typos

Nick


"ticephotos" wrote in message
...
I tried the filter and still had almost all of the duplicate entries. How
would I write the code in VB to delete the duplicates?

"Nick" wrote:

There are a couple of ways to do this.
One is using VB and a procedure to delete duplicate items.
Or you could use Data- Filter- Advanced Filter
By selecting the Select Unique Records only and copying to another range
you
will get a list of non-duplicate items.

Nick


"ticephotos" wrote in message
...
I work with a list of about 3500 entries in Excel that is updated every
2
weeks. Is there any way to easily delete out duplicate entries without
manually sorting the list and deleting them one at a time?






  #5   Report Post  
ticephotos
 
Posts: n/a
Default

Ok, I did something wrong. It says "Arguement not optional" when I run it.
All I did was copy and paste the code minus (Assuming the Cell Selected is
the start of your
list and contains the duplicate values). What did I do wrong?


"Nick" wrote:

Sub DeleteDups

Dim rInput as range
Dim rNext as range


Set rInput = ActiveCell (Assuming the Cell Selected is the start of your
list and contains the duplicate values)

rInput.Sort key1:=rInput.range

Do until isempty(rinput.value)
set rNext = rInput.Offset(1)
if rInput.Value=rNext.Value then
rInput.Entirerow.Delete
end if
set rInput = rNext
Loop


End Sub

I have tested this actual code put I know this works if I haven't made any
stupid typos

Nick


"ticephotos" wrote in message
...
I tried the filter and still had almost all of the duplicate entries. How
would I write the code in VB to delete the duplicates?

"Nick" wrote:

There are a couple of ways to do this.
One is using VB and a procedure to delete duplicate items.
Or you could use Data- Filter- Advanced Filter
By selecting the Select Unique Records only and copying to another range
you
will get a list of non-duplicate items.

Nick


"ticephotos" wrote in message
...
I work with a list of about 3500 entries in Excel that is updated every
2
weeks. Is there any way to easily delete out duplicate entries without
manually sorting the list and deleting them one at a time?








  #6   Report Post  
Gord Dibben
 
Posts: n/a
Default

tice

Remove the ".range" from rInput.Sort key1:=rInput.range

Sub DeleteDups()
Dim rInput As Range
Dim rNext As Range
Set rInput = ActiveCell
rInput.Sort key1:=rInput.Range
Do Until IsEmpty(rInput.Value)
Set rNext = rInput.Offset(1)
If rInput.Value = rNext.Value Then
rInput.EntireRow.Delete
End If
Set rInput = rNext
Loop
End Sub


Gord Dibben Excel MVP

On Tue, 3 May 2005 11:12:05 -0700, "ticephotos"
wrote:

Ok, I did something wrong. It says "Arguement not optional" when I run it.
All I did was copy and paste the code minus (Assuming the Cell Selected is
the start of your
list and contains the duplicate values). What did I do wrong?


"Nick" wrote:

Sub DeleteDups

Dim rInput as range
Dim rNext as range


Set rInput = ActiveCell (Assuming the Cell Selected is the start of your
list and contains the duplicate values)

rInput.Sort key1:=rInput.range

Do until isempty(rinput.value)
set rNext = rInput.Offset(1)
if rInput.Value=rNext.Value then
rInput.Entirerow.Delete
end if
set rInput = rNext
Loop


End Sub

I have tested this actual code put I know this works if I haven't made any
stupid typos

Nick


"ticephotos" wrote in message
...
I tried the filter and still had almost all of the duplicate entries. How
would I write the code in VB to delete the duplicates?

"Nick" wrote:

There are a couple of ways to do this.
One is using VB and a procedure to delete duplicate items.
Or you could use Data- Filter- Advanced Filter
By selecting the Select Unique Records only and copying to another range
you
will get a list of non-duplicate items.

Nick


"ticephotos" wrote in message
...
I work with a list of about 3500 entries in Excel that is updated every
2
weeks. Is there any way to easily delete out duplicate entries without
manually sorting the list and deleting them one at a time?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge, update, and add only new entries into a list from other she Chab Excel Worksheet Functions 1 May 1st 05 11:05 PM
Create a cascading list box using Excel JPB Excel Discussion (Misc queries) 1 February 24th 05 08:43 PM
How can I purge duplicate entries in Excel Bootsy Excel Discussion (Misc queries) 2 February 18th 05 06:20 PM
How do I import a Windows Explorer list into Excel? Gord Dibben Excel Discussion (Misc queries) 0 December 1st 04 10:20 PM
Duplicate records in Excel Sheidsa Excel Discussion (Misc queries) 1 November 30th 04 12:23 AM


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"