Delete duplicate rows, but keeping the last entry

Lizard07

Board Regular
Joined
Jul 20, 2011
Messages
103
I currently have a code that deletes duplicates based on the contents of row E. The only change I would like to make is to have it keep the last entry of each set of duplicates. Please see below for example - in this case the duplicate entry would be based off of the Route ID column.

<TABLE style="WIDTH: 426pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=567 x:str><COLGROUP><COL style="WIDTH: 97pt; mso-width-source: userset; mso-width-alt: 4717" width=129><COL style="WIDTH: 46pt; mso-width-source: userset; mso-width-alt: 2230" width=61><COL style="WIDTH: 47pt; mso-width-source: userset; mso-width-alt: 2304" width=63><COL style="WIDTH: 53pt; mso-width-source: userset; mso-width-alt: 2596" width=71><COL style="WIDTH: 47pt; mso-width-source: userset; mso-width-alt: 2267" width=62><COL style="WIDTH: 37pt; mso-width-source: userset; mso-width-alt: 1792" width=49><COL style="WIDTH: 99pt; mso-width-source: userset; mso-width-alt: 4827" width=132><TBODY><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: #339966; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 height=18 width=129>Driver Name</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: #339966; WIDTH: 46pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 width=61>Driver ID</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: #339966; WIDTH: 47pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 width=63>Route ID</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: #339966; WIDTH: 53pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 width=71>Start Time</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: #339966; WIDTH: 47pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 width=62>End Time</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: #339966; WIDTH: 37pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 width=49>Site ID</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: #339966; WIDTH: 99pt; BORDER-TOP: #339966 1pt solid; BORDER-RIGHT: #339966 1pt solid" class=xl22 width=132>Site Name</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: white; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 height=18 width=129>SMITH</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=61 align=right x:num>3708858</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=63 align=right x:num>231133</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: silver; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 height=18 width=129>SMITH</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=61 align=right x:num>3708858</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=63 align=right x:num>231133</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: white; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 height=18 width=129>ALLEN</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=61 align=right x:num>1360958</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=63 align=right x:num>231137</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: silver; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 height=18 width=129>ALLEN</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=61 align=right x:num>1360958</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=63 align=right x:num>231137</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: white; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 height=18 width=129>ALLEN</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=61 align=right x:num>1360958</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=63 align=right x:num>231137</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=62 align=right x:num="40757">8/2/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: silver; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 height=18 width=129>JONES</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=61 align=right x:num>1258921</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=63 align=right x:num>332805</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: white; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 height=18 width=129>BERNETT</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=61 align=right x:num>4700233</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=63 align=right x:num>232884</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: silver; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 height=18 width=129>BERNETT</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=61 align=right x:num>4700233</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=63 align=right x:num>232884</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: white; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 height=18 width=129>BERNETT</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=61 align=right x:num>4700233</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=63 align=right x:num>232884</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl24 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: white; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl23 width=132></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966 1pt solid; BACKGROUND-COLOR: silver; WIDTH: 97pt; HEIGHT: 13.5pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 height=18 width=129>BERNETT</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 46pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=61 align=right x:num>4700233</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=63 align=right x:num>232884</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 53pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=71 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 47pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl26 width=62 align=right x:num="40756">8/1/2011</TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 37pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=49 align=right x:num></TD><TD style="BORDER-BOTTOM: #339966 1pt solid; BORDER-LEFT: #339966; BACKGROUND-COLOR: silver; WIDTH: 99pt; BORDER-TOP: #339966; BORDER-RIGHT: #339966 1pt solid" class=xl25 width=132></TD></TR></TBODY></TABLE>


THis is the current code I have:

Dim x As Long, LastRow As Long
LastRow = Range("E65536").End(xlUp).Row
For x = LastRow To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("E1:E" & x), Range("E" & x).Text) > 1 Then
Range("E" & x).EntireRow.Delete
End If
Next x


Thanks!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try:

Code:
Sub Test()
    Dim x As Long, LastRow As Long
    LastRow = Range("E65536").End(xlUp).Row
    For x = LastRow To 1 Step -1
        If Application.WorksheetFunction.CountIf(Range("C1:C" & LastRow), Range("C" & x).Text) > 1 Then
            If Application.WorksheetFunction.CountIf(Range("C" & x + 1 & ":C" & LastRow + 1), Range("C" & x).Text) > 0 Then
                Range("C" & x).EntireRow.Delete
            End If
        End If
    Next x
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,559
Messages
6,179,517
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top