Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete duplicates and more!

I'm trying to delete duplicates lines. I have a list with 40.000
items
And the list looks some like this:

A42U002-49 (x)
A42U002-49-0
A42U002-50 (x)
A42U002-50-0
A42U002-50-0 (x)
A42U002-50-01
A42U002-51

All lines ending with -0 is the same as line without but not line with
-1.

So I have to delete all the line mark with (x)

Anyone have an Idea how to do this ?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Delete duplicates and more!

I'm not sure this will work in your case, but try this.
presuming data start from A1, and it will take some time if data many.

Sub deltest()
Dim start As Long, comp As Long
Dim endcell As Range
Application.ScreenUpdating = False
start = 1
comp = start + 1
Set endcell = Cells(Cells.Rows.Count, "a").End(xlUp).Offset(1, 0)
Do
If Cells(start, "a") < Cells(comp, "a") Then
If start < (comp - 1) Then
Rows(start + 1 & ":" & comp - 1).Delete
comp = start + 1
End If
start = comp
End If
comp = comp + 1
Loop Until (comp endcell.Row)
start = 1
comp = start + 1
Set endcell = Cells(Cells.Rows.Count, "a").End(xlUp).Offset(1, 0)
Do
If Cells(start, "a") & "-0" = Cells(comp, "a") Then
Rows(start).Delete
Else
start = start + 1
comp = start + 1
End If
Loop Until (comp endcell.Row)
End Sub

keizi

"Ramses" wrote in message
oups.com...
I'm trying to delete duplicates lines. I have a list with 40.000
items
And the list looks some like this:

A42U002-49 (x)
A42U002-49-0
A42U002-50 (x)
A42U002-50-0
A42U002-50-0 (x)
A42U002-50-01
A42U002-51

All lines ending with -0 is the same as line without but not line with
-1.

So I have to delete all the line mark with (x)

Anyone have an Idea how to do this ?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Delete duplicates and more!

Thanks a lot
It takes some time but it works like a charm.

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
Delete duplicates Angie M. Excel Worksheet Functions 4 February 4th 10 03:56 AM
delete both duplicates savbci Excel Discussion (Misc queries) 2 July 23rd 08 03:46 PM
Delete duplicates in a row LM Excel Worksheet Functions 3 July 8th 08 07:20 PM
delete duplicates macro to color instead of delete DKY[_90_] Excel Programming 4 December 22nd 05 05:44 PM
Delete duplicates Carter68 Excel Worksheet Functions 3 June 15th 05 12:01 AM


All times are GMT +1. The time now is 08:19 AM.

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"