Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing double lines by macro in excel 97
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing double lines by macro in excel 97
Thank you very much !
Jerry JLGWhiz schreef: I took a second look at the code and decided it needed a fix. Here is the one that works right. Sub DelDupRow() LR = Cells(Rows.Count, 1).End(xlUp).Row Range("$A$1").Activate Do For i = 1 To LR x = ActiveCell.Address If Range(x).Value = Range(x).Offset(1, 0).Value And Range(x).Offset(0, 1).Value = Range(x).Offset(1, 1).Value And Range(x).Offset(0, 2).Value = Range(x).Offset(1, 2).Value Then Range(x).Offset(1, 0).EntireRow.Delete End If Next i Range(x).Offset(1, 0).Activate Loop Until Range(x) = "" End Sub "Bit3m3" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I type in the same box in excel without removing any lines | Excel Discussion (Misc queries) | |||
Double lines | Excel Worksheet Functions | |||
SharePoint-Excel Link Create Double Lines When Updating | Excel Discussion (Misc queries) | |||
Removing unnamed Legend lines from an Excel template | Charts and Charting in Excel | |||
Removing lines of data that do not contain required data (macro) | Excel Programming |