我有两个数组,我试图提取其中的公共值,函数 findUniques 应该返回连接并用逗号分隔的字符串(它们是名称)。我想我很接近,但我找不到问题所在。第 10 行出现错误
Function findUniques(astrArray1() As String, astrArray2() As String) As String
Dim blnMP5 As Boolean
blnMP5 = False
Dim counter1 As Long
Dim counter2 As Long
For counter1 = LBound(astrArray1) To UBound(astrArray1)
For counter2 = LBound(astrArray1) To UBound(astrArray2)
If astrArray1(counter1) = astrArray2(counter2) Then
blnMP5 = False
If blnMP5 = True Then
findUniques() = findUniques & "," & "astrArray1()"
End If
End If
Next counter2
Next counter1
End Function