Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 519
Default Add one more criteria

Hello from Steved

The below Formula finds Duplicates and deletes.

Question please How do I also ask the formula to check Column E

Thefore the find Criteria would be Columns "A", "D", "E" then the duplicates
found Delete.

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, "D").Value <= Cells(RowNdx - 1, "D").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub

Thankyou
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Add one more criteria

Hi SteveD

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, "D").Value <= Cells(RowNdx - 1, "D").Value Then
If Cells(RowNdx, "E").Value <= Cells(RowNdx - 1, "E").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
End If
Next RowNdx
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Steved" wrote in message
...
Hello from Steved

The below Formula finds Duplicates and deletes.

Question please How do I also ask the formula to check Column E

Thefore the find Criteria would be Columns "A", "D", "E" then the
duplicates
found Delete.

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, "D").Value <= Cells(RowNdx - 1, "D").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub

Thankyou



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 519
Default Add one more criteria

Thankyou Bob

"Bob Phillips" wrote:

Hi SteveD

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, "D").Value <= Cells(RowNdx - 1, "D").Value Then
If Cells(RowNdx, "E").Value <= Cells(RowNdx - 1, "E").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
End If
Next RowNdx
End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Steved" wrote in message
...
Hello from Steved

The below Formula finds Duplicates and deletes.

Question please How do I also ask the formula to check Column E

Thefore the find Criteria would be Columns "A", "D", "E" then the
duplicates
found Delete.

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, "D").Value <= Cells(RowNdx - 1, "D").Value Then
Rows(RowNdx).Delete
Else
Rows(RowNdx - 1).Delete
End If
End If
Next RowNdx
End Sub

Thankyou




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
=DMIN(database,field,criteria) question about criteria Dummy Excel Discussion (Misc queries) 2 April 16th 07 08:02 PM
criteria 1(a,b,c), criteria 2 (T,F) - Results (3 answers) achievab Kikkoman Excel Discussion (Misc queries) 5 July 1st 05 11:05 PM
Countif using format criteria....not number criteria? Troy Excel Worksheet Functions 1 April 20th 05 04:50 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Saleem Excel Worksheet Functions 1 January 12th 05 10:54 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Arain Excel Worksheet Functions 1 January 12th 05 08:33 AM


All times are GMT +1. The time now is 03:33 AM.

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"