Hey guys my assignment is to create a VBA function that takes in two arrays and spits out the unique names that are not in both arrays.
This is what I have so far but I am running into many issues (including 'Run-Time Error 9")
I am fairly new to VBA so any help would be greatly appreciated!!
Function UniqueNames(astrArray1() As String, astrArray2() As String) As String
Dim i As Long
Dim o As Long
For i = LBound(astrArray1) To UBound(astrArray1)
If astrArray1(i) <> astrArray2(i) Then
findUniques = findUniques & 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
End Function
This is what I have so far but I am running into many issues (including 'Run-Time Error 9")
I am fairly new to VBA so any help would be greatly appreciated!!
Function UniqueNames(astrArray1() As String, astrArray2() As String) As String
Dim i As Long
Dim o As Long
For i = LBound(astrArray1) To UBound(astrArray1)
If astrArray1(i) <> astrArray2(i) Then
findUniques = findUniques & 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
End Function