Hi Fabulous people! I am looking at removing duplicates if they contain False in a certain cell but only if they are duplicates
[TABLE="width: 581"]
<tbody>[TR]
[TD]T
[/TD]
[TD]U
[/TD]
[TD]V
[/TD]
[TD]W
[/TD]
[TD]X
[/TD]
[TD]Y
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]TRUE
[/TD]
[TD]30
[/TD]
[TD]0
[/TD]
[TD]26707343702TRUETRUE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 642"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody></tbody>[/TABLE]
So the cells that contain FALSE in the 3rd Column (Column V) are deleted as long as there is a duplicate. I've tried to use someone else's code but I haven't changed it correctly to reflect my own information as its not working. The code I have is as follows
Dim lastRow1 As Long
Dim myRow As Long
Application.ScreenUpdating = False
' Sort by columns A and B
Range("A1").CurrentRegion.Sort _
key1:=Range("T1"), order1:=xlAscending, _
key2:=Range("V1"), order2:=xlDescending, Header:=xlYes
' Find last row in column A
lastRow1 = Cells(Rows.Count, "A").End(xlUp).Row
' Loop through all rows backwards up to row 2
For myRow = lastRow1 To 2 Step -1
' Check to see if columns A match and column B has "Y" in row, and "N" in row above
If Cells(myRow, "T") = Cells(myRow - 1, "T") And _
UCase(Cells(myRow, "V")) = "True" And _
UCase(Cells(myRow - 1, "V")) = "False" Then
' If so, delete row
Rows(myRow).Delete
End If
Next myRow
Application.ScreenUpdating = True
Appreciate any help you can give me!
[TABLE="width: 581"]
<tbody>[TR]
[TD]T
[/TD]
[TD]U
[/TD]
[TD]V
[/TD]
[TD]W
[/TD]
[TD]X
[/TD]
[TD]Y
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]TRUE
[/TD]
[TD]30
[/TD]
[TD]0
[/TD]
[TD]26707343702TRUETRUE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
[TR]
[TD]26707343702
[/TD]
[TD]TRUE
[/TD]
[TD]FALSE
[/TD]
[TD][/TD]
[TD][/TD]
[TD]26707343702TRUEFALSE
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 642"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody></tbody>[/TABLE]
So the cells that contain FALSE in the 3rd Column (Column V) are deleted as long as there is a duplicate. I've tried to use someone else's code but I haven't changed it correctly to reflect my own information as its not working. The code I have is as follows
Dim lastRow1 As Long
Dim myRow As Long
Application.ScreenUpdating = False
' Sort by columns A and B
Range("A1").CurrentRegion.Sort _
key1:=Range("T1"), order1:=xlAscending, _
key2:=Range("V1"), order2:=xlDescending, Header:=xlYes
' Find last row in column A
lastRow1 = Cells(Rows.Count, "A").End(xlUp).Row
' Loop through all rows backwards up to row 2
For myRow = lastRow1 To 2 Step -1
' Check to see if columns A match and column B has "Y" in row, and "N" in row above
If Cells(myRow, "T") = Cells(myRow - 1, "T") And _
UCase(Cells(myRow, "V")) = "True" And _
UCase(Cells(myRow - 1, "V")) = "False" Then
' If so, delete row
Rows(myRow).Delete
End If
Next myRow
Application.ScreenUpdating = True
Appreciate any help you can give me!