I need to create a function that checks two arrays and finds the Unique names from both and prints it.
SO
Columns
A B
Joe Joe
Moe Moe
Alex John
Matt Matt
And my function =unique(A1:A4, B1:B4) should equal Alex, John
I have this but it is not working
Function Uniques(astrArray1() As String, astrArray2() As String) As String
'You probably want to add code here
Dim i As Long
Dim o As Long
For i = LBound(astrArray1) To UBound(astrArray1)
If astrArray1(i) <> astrArray2(i) Then
findUniques = findUniques & astrArray1(i) & ","
End If
Next
For o = LBound(astrArray2) To UBound(astrArray2)
If astrArray1(o) <> astrArray2(o) Then
findUniques = findUniques & astrArray2(o) & ","
End If
Next o
Any help is greatly appreciated!
SO
Columns
A B
Joe Joe
Moe Moe
Alex John
Matt Matt
And my function =unique(A1:A4, B1:B4) should equal Alex, John
I have this but it is not working
Function Uniques(astrArray1() As String, astrArray2() As String) As String
'You probably want to add code here
Dim i As Long
Dim o As Long
For i = LBound(astrArray1) To UBound(astrArray1)
If astrArray1(i) <> astrArray2(i) Then
findUniques = findUniques & astrArray1(i) & ","
End If
Next
For o = LBound(astrArray2) To UBound(astrArray2)
If astrArray1(o) <> astrArray2(o) Then
findUniques = findUniques & astrArray2(o) & ","
End If
Next o
Any help is greatly appreciated!