Este es un ejemplo para que lo adaptes a tus necesidades. Si tienes dudas trata de investigar.
Sub Combine_No_Dupes()
Dim CombArray() As Variant
Dim Range1 As Range, Range2 As Range, OutputCell As Range
Set Range1 = Range("List1")
Set Range2 = Range("List2")
Set OutputCell = Range("F3")
' Load the combined array with all values from both lists.
n = Range1.Cells.Count + Range2.Cells.Count
ReDim CombArray(n, 2)
For Each cell In Range1
i = i + 1
CombArray(i, 1) = cell.Value
Next cell
For Each cell In Range2
i = i + 1
CombArray(i, 1) = cell.Value
Next cell
' Bubble Sort the combined array.
sorted = False
While Not sorted
sorted = True
For i = 1 To UBound(CombArray) - 1
If CombArray(i, 1) > CombArray(i + 1, 1) Then
stor1 = CombArray(i, 1)
CombArray(i, 1) = CombArray(i + 1, 1)
CombArray(i + 1, 1) = stor1
sorted = False
Exit For
End If
Next i
Wend
' Mark all duplicates in the array. True = Duplicate
CombArray(1, 2) = False
For i = 1 To UBound(CombArray) - 1
If CombArray(i, 1) = CombArray(i + 1, 1) Then
CombArray(i + 1, 2) = True
Else
CombArray(i + 1, 2) = False
End If
Next i
' Output results to range ignoring the duplicates.
j = 0
For i = 1 To UBound(CombArray)
If Not CombArray(i, 2) Then
OutputCell.Offset(j, 0).Value = CombArray(i, 1)
j = j + 1
End If
Next i
End Sub
[email protected]