8/15/2018 - 11:38 AM

Merge Arrays

and keep unique values only

Function MergeArrays(arr1 As Variant, arr2 As Variant, OutputArray As Variant) As Variant
'Description:   Merges two single-dimensional arrays and removes duplicates
'Dependencies:  Array Support module
'               RemoveDuplicates

Dim tempArr As Variant

'   Default value
    MergeArrays = False
    tempArr = arr1
    If ConcatenateArrays(tempArr, arr2) = False Then Exit Function
    If RemoveDuplicates(tempArr, OutputArray) = False Then Exit Function
    MergeArrays = True

End Function