Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
How do I type in the same box in excel without removing any lines Regina03 Excel Discussion (Misc queries) 2 April 9th 08 09:07 PM
Double lines dbs Excel Worksheet Functions 0 July 13th 07 03:50 PM
SharePoint-Excel Link Create Double Lines When Updating Ceblare Excel Discussion (Misc queries) 0 July 10th 07 02:00 PM
Removing unnamed Legend lines from an Excel template rdemyan Charts and Charting in Excel 6 January 23rd 07 01:56 PM
Removing lines of data that do not contain required data (macro) Sean[_7_] Excel Programming 1 May 21st 04 03:53 PM


All times are GMT +1. The time now is 07:04 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"