First let me say that I'm very novice to VBA and I only use it occasionally.
Anyway, I have 2 lists in separate columns of Excel and I'd like to take the union of those 2 lists and display the union in a 3rd column. How can I do this?
I started with the following code but am not sure where to go to next:
--------
Sub Test()
Set FirstList = Worksheets("Data").Range("A:A")
Set SecondList = Worksheets("Data").Range("B:B")
Set UnionObject = Union(FirstList, SecondList)
Worksheets("Data").Range("C:C") = UnionObject
End Sub
--------
Thanks
Anyway, I have 2 lists in separate columns of Excel and I'd like to take the union of those 2 lists and display the union in a 3rd column. How can I do this?
I started with the following code but am not sure where to go to next:
--------
Sub Test()
Set FirstList = Worksheets("Data").Range("A:A")
Set SecondList = Worksheets("Data").Range("B:B")
Set UnionObject = Union(FirstList, SecondList)
Worksheets("Data").Range("C:C") = UnionObject
End Sub
--------
Thanks