duplicate

M

Matt

I have three columns A,B,C, each represents a month July, Aug, Sep. Each
column shows the start date of the client; however, their ID# carries over
the the next month. EX;
July Aug Sep
shp0053 shp0026 shp0026
shp0067 shp0053 shp0053
shp0181 shp0067 shp0067
shp0234 shp0181 shp0181
shp0521 shp0234 shp0234 What formula do I use to get rid of the
duplicates in column B, and C, but not A? the list is 400 lines long please
help.
 
D

Don Guillett

Should do it

Sub nodupesincolbandcolc()
lr = Cells(Rows.Count, 1).End(xlUp).Row
On Error Resume Next
For i = 2 To lr
With Range(Cells(2, 2), Cells(lr, 3))
' Set c = .Find(Cells(i, 1), LookIn:=xlValues)
Set c = .Find(Cells(i, 1), LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False)


If Not c Is Nothing Then
firstAddress = c.Address
Do
' MsgBox c.Row & " " & c.Column
c.ClearContents
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top