Question : Delete line with duplicate

How can I delete duplicates and just have one occurance showing?   I have attached code that turns it red but I would like to delete dups.  Thanks
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
Dim Counter
Dim i As Integer


Sub Dups()
'
      ' NOTE: You must select the first cell in the column and
      ' make sure that the column is sorted before running this macro.
      ScreenUpdating = False
      FirstItem = ActiveCell.Value
      SecondItem = ActiveCell.Offset(1, 0).Value
      offsetcount = 1
      Do While ActiveCell <> ""
         If FirstItem = SecondItem Then
           ActiveCell.Offset(offsetcount, 0).Interior.Color = RGB(255, 0, 0)
           ActiveCell.Offset(offsetcount - 1, 0).Interior.Color = RGB(255, 0, 0)
           offsetcount = offsetcount + 1
           SecondItem = ActiveCell.Offset(offsetcount, 0).Value
         Else
           
           ActiveCell.Offset(offsetcount, 0).Select
           FirstItem = ActiveCell.Value
           SecondItem = ActiveCell.Offset(1, 0).Value
           offsetcount = 1
         End If
         
       Loop
            

   End Sub

Answer : Delete line with duplicate

You can go here for the network installation file:
http://www.microsoft.com/downloads/details.aspx?FamilyId=5B33B5A8-5E76-401F-BE08-1E1555D4F3D4&displaylang=en


Hope this helps!

:o)

Bartender_1
Random Solutions  
 
programming4us programming4us