I'm trying to take a list of data (1D array as variant containing lots of text inputs) and run this input array into a function which returns another array with a filtered list of maybe 8 unique entries from around 700+ in the input array. So far I have this, but I'm getting a type-mismatch error with the VBA filter - any ideas why?:
Function RemoveDupes(InputArray) As Variant
Dim Array_2()
Dim eleArr_1 As Variant
Dim x As Integer
x = 0
On Error Resume Next
For Each eleArr_1 In InputArray
If UBound(Filter(InputArray, eleArr_1)) = 0 Then
ReDim Preserve Array_2(x)
Array_2(x) = eleArr_1
x = x + 1
End If
Next
RemoveDupes = Array_2
End Function
Function RemoveDupes(InputArray) As Variant
Dim Array_2()
Dim eleArr_1 As Variant
Dim x As Integer
x = 0
On Error Resume Next
For Each eleArr_1 In InputArray
If UBound(Filter(InputArray, eleArr_1)) = 0 Then
ReDim Preserve Array_2(x)
Array_2(x) = eleArr_1
x = x + 1
End If
Next
RemoveDupes = Array_2
End Function
Last edited: