Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Delete Row if value in row changes

this code removes rows that match for the first 7 columns. No point in
filter for column "G" as if it differs, it won't be deleted and you'll see
it anyways

Option Explicit
Sub removeDupes()
Dim matched As Boolean
Dim cl As Long ' column counte
Dim rw As Long ' row counter
For rw = 2000 To 2 Step -1
matched = True
For cl = 1 To 7
If Cells(rw, cl) < Cells(rw - 1, cl) Then
matched = False
Exit For
End If
Next
If matched Then
Rows(rw).Delete
End If
Next rw
End Sub




"jscorsone" wrote in message
...
I have a workbook with duplicate rows where multiple columns may remain
the
same, but column F may change from row to row.

I'm trying to delete all rows that are direct duplicates of the row above
it
so I can view just the rows where column F is different (if all other
columns
are similar as row above.)

Thanks for any assistance!


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
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 05:16 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 04:38 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 08:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"