Thread: compare columns
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dan R. Dan R. is offline
external usenet poster
 
Posts: 220
Default compare columns

Ned,

Here's one way:

Sub Test()
Dim lRow As Long
Dim rng As Range, i As Range, xRng As Range

lRow = Range("A65536").End(xlUp).Row
Set rng = Range(Cells(1, 2), Cells(lRow, 2))

For Each i In rng
Set xRng = rng.Find(What:=i.Offset(0, -1).Value, _
LookIn:=xlValues, MatchCase:=False)
If xRng Is Nothing Then
i.Offset(0, -1).Copy i.Offset(0, 1)
End If
Next i

End Sub

--
Dan Oakes