View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Pete[_22_] Pete[_22_] is offline
external usenet poster
 
Posts: 31
Default Removing double lines by macro in excel 97

If the text for one line is in one cell (A2 A3 A4 etc) then you could do
this easily using Advance Filter
Place the first piece of data in A2 headed by some heading eg Data (with
bold/italics etc to give it header 'status') :

Data
28-12-2006 51803 6511927 Nogueira & Barroco Lda Faxen
28-12-2006 51803 6511927 Nogueira & Barroco Lda Faxen
28-12-2006 51803 6511927 Nogueira & Barroco Lda Faxen


Now run this macro:
Sub FilterOutDuplicates()
Range("A1", Range("A65536").End(xlUp)).AdvancedFilter
Action:=xlFilterCopy, CopyToRange:=Range("B1"), Unique:=True
Range("A1", Range("A65536").End(xlUp)).ClearContents
Range("B1", Range("B65536").End(xlUp)).Cut Range("A1")
End Sub



"Bit3m3" wrote in message
ups.com...
Hello,

I'm using excel 97 and I want to save paper with my prints...so I need
your help :)
I'm importing into excel a couple of lines (this may vary day by day.)
there I copy by a simple macro a vertical lookup function an action I
have to perform by each rule.
due to some technical issue I receive double and triple lines (even
four lines if I'm lucky).
I have to print this report so it would be nice if a macro could
automaticly remove lines untill a line is unique.

so by example.
A B C D E
1 28-12-2006 51803 6511927 Nogueira & Barroco Lda Faxen
2 28-12-2006 51803 6511927 Nogueira & Barroco Lda Faxen
3 28-12-2006 51803 6511927 Nogueira & Barroco Lda Faxen

They are always grouped but I want to remove (not hide) the 2 or three
lines
In one sheet a hundred ore more lines are like this

Could any one help?
If I'm not clear please also tell me and I'll try to clear things.

Thnx Jerry