LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default comparing rows and deletion


hi,

i want to compare rows and delete the rows

previously i got an marco help from the group but it is comparing the
whole string
of the row

for example

it is comparing rows

1 0 1 0
1 0 1 1
0 1 0 0

for these rows the marco is deleting the thrid row because 1010 is
0100
but it shouldn't delete it because we have to compare by cell by cell
in the whole row

1 0 ,0 <1 ,1 0,0 = 0

but 0<1
so it should not delete the row.

the marco is as follows

Sub ab()
Dim lastrow As Long, i As Long
Dim cell As Range, c As Range
Dim sStr1 As String, sStr2 As String
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastrow
Set cell = Cells(i, 1).Resize(1, 100)
sStr1 = "": sStr2 = ""
For Each c In cell
sStr2 = sStr2 & c.Value
sStr1 = sStr1 & c.Offset(-1, 0).Value
Next
If sStr2 < sStr1 Then
cell.ClearContents
End If
Next
End Sub

but i need a marco which compares cell by cell in the whole row and
delete if all cells are than all cells in the other row else compare
with other row till end of xlsheet.

So, can any one plz help me A.S.P

thanks
sree


--
sreedhar
------------------------------------------------------------------------
sreedhar's Profile: http://www.excelforum.com/member.php...o&userid=27582
View this thread: http://www.excelforum.com/showthread...hreadid=474533

 
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
rows identification and deletion TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 April 2nd 07 04:42 AM
Automatic Deletion of Rows ai18ma New Users to Excel 6 April 5th 06 08:25 AM
On deletion of rows Stephen Howe Excel Discussion (Misc queries) 2 October 7th 05 06:02 PM
Deletion of rows where a value is satisfied Larry Wallis[_2_] Excel Programming 2 February 22nd 05 01:36 PM
Deletion of rows where a value is satisfied Larry Wallis Excel Worksheet Functions 1 February 22nd 05 12:41 PM


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