ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   duplicate (https://www.excelbanter.com/excel-discussion-misc-queries/243532-duplicate.html)

Matt

duplicate
 
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.

Don Guillett

duplicate
 
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
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Matt" wrote in message
...
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.




All times are GMT +1. The time now is 12:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com