Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Dup check 2 columns - need it to delete correct one

I'm having trouble fixing this to be right in my situation... Any thoughts?
You've been so helpful today!

Sub DeleteTheOldies()
Dim RowNdx As Long
For RowNdx = Range("A1").End(xlDown).Row To 2 Step -1
If Cells(RowNdx, "A").Value = Cells(RowNdx - 1, "A").Value Then
If Cells(RowNdx, "B").Value <= Cells(RowNdx - 1, "B").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub


"Chance M" wrote:

Thanks Eduardo. I'll try that and I think it should work.

"Eduardo" wrote:

Hi,
In that case look into CPearson Web, in the middle of the page he has how to
delete duplicate rows with a macro

http://www.cpearson.com/excel/deleting.htm



"Chance M" wrote:

Thanks Eduardo. I still need to keep one copy of any that don't have a U in
column B by them as well. So in the below example I would be left with:

Jane Doe U
John Doe U
Jack Doe

Does that make sense?




"Eduardo" wrote:

Hi,
If the rows you want to keep are the ones with a U, apply a filter to that
column, uncheck the U, then higlight all the filtered rows, right click on
the mouse, delete, then go to the filter and check the U

"Chance M" wrote:

Using Excel 2007, I have a two column list with over 100,000 rows.

Example:

Jane Doe U
Jane Doe
John Doe
John Doe U
John Doe
Jack Doe
Jack Doe

I want to run a dup check to make sure there is only one Jane, Jack or John
Doe, but the copy I want to stay is the one with a U behind it if there is
one (wouldn't matter which row is kept for Jack). From what I've done so far,
the dup check simply keeps whichever record is in the top row. Seems like it
should be an easy fix, but I'm lost. Please help.

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 delete a check box. akkrug New Users to Excel 1 May 3rd 07 05:19 PM
delete a check box lldjc Excel Discussion (Misc queries) 2 April 15th 06 06:55 PM
Check Box wont Delete Brandt Excel Discussion (Misc queries) 3 June 7th 05 09:37 PM
How do I correct a cyclic redundancy check error Jeff Excel Discussion (Misc queries) 1 March 25th 05 06:09 PM
How do I correct a cyclic redundancy check error Ramakrishnan Rajamani Excel Discussion (Misc queries) 0 March 25th 05 06:01 PM


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