Function strUniqueArray(array_in As Variant) As Variant
'Finalidade : Retirar os itens repetidos do array.
Dim array_aux As Variant
Dim array_out() As Variant
Dim ind As Integer
ind = 0
array_aux = array_in
If Isarray(array_aux) Then
Forall a In array_aux
If ind = 0 Then
Redim Preserve array_out(ind)
array_out(ind) = a
ind = ind + 1
Else
If strOcurrencesInArray(array_out, a) = 0 Then
Redim Preserve array_out(ind)
array_out(ind) = a
ind = ind + 1
End If
End If
End Forall
Else
strUniqueArray = array_in
Exit Function
End If
strUniqueArray = array_out
End Function
Nenhum comentário:
Postar um comentário