10 & 15 Names are in their respective columns
No gaps in the name list
It could be placed in any order in sheet3
Give the following macro a try. Where indicated, adjust the Worksheet names
and the Range references (the "A1:A" parts) for each worksheet to match your
actual worksheets names, columns and starting row for the lists.
Rick
Sub CopyNames()
Dim X As Long
Dim Cel As Range
Dim WS1range As Range
Dim WS2range As Range
Dim LongerList As Range
Dim ShorterList As Range
Dim WS3 As Worksheet
Dim EmptyCell As Long
' **** Adjust references to match your worksheet ****
With Worksheets("Sheet1")
Set WS1range = .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
End With
With Worksheets("Sheet2")
Set WS2range = .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
End With
Set WS3 = Worksheets("Sheet3")
' ***************************************************
If WS1range.Count > WS2range.Count Then
Set LongerList = WS1range
Set ShorterList = WS2range
Else
Set LongerList = WS2range
Set ShorterList = WS1range
End If
LongerList.Copy Destination:=WS3.Range("A1")
For Each Cel In ShorterList
EmptyCell = WS3.Cells(Rows.Count, "A").End(xlUp).Row + 1
If WS3.Range("A1:A" & EmptyCell).Find(Cel.Text) Is Nothing Then
WS3.Range("A" & EmptyCell).Value = Cel.Text
End If
Next
End Sub