Joining/appending two columns of data

  • Thread starter Thread starter Richard Edwards
  • Start date Start date
R

Richard Edwards

I have two columns of data. For example; one with a list of people in the IT
department and the other a list of people in the whole company.

I am after a way of joining these two lists of data into one list and
removing the duplicates; ie only include the people who are in the IT
department once as they will appear on both lists.

I am at a loss how to do this. Any ideas?

Thanks.

Richard
 
If they aren't already there then
if col D has whole company and col E has the IT

Sub comparecol()
For Each c In Range("e1:e14")
x = Cells(Rows.Count, "d").End(xlUp).Row + 1
If Range("d1:d14").Find(c) Is Nothing Then
'MsgBox c.Address
Cells(x, "d") = c
End If
Next
End Sub
 
Hi,

Option Explicit
Sub TEST()

Dim RNG_1 As Range
Dim RNG_2 As Range
Dim CL As Range
Dim R As Long

Set RNG_1 = Range("B2:B20")
Set RNG_2 = Range("D2:D20")

For Each CL In RNG_1

R = Cells(Rows.Count, RNG_2.Column).End(xlUp).Row

If R < RNG_2.Row Then
R = RNG_2.Row
Else
R = R + 1
End If

If RNG_2.Find(What:=CL.Value, LookAt:=xlWhole) Is Nothing Then
Cells(R, RNG_2.Column).Value = CL.Value
End If
Next

End Sub


--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 
Back
Top