Created
January 13, 2021 07:43
-
-
Save thoriqmacto/d054059e6195bafc0d3139a9a5dde85e to your computer and use it in GitHub Desktop.
[VBA] Boolean function to return whether a 1D-array members is unique or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function IsArrayUnique(tArr As Variant) As Boolean | |
Dim out As Boolean, tOut As Double | |
Dim i As Long | |
For Each t In tArr | |
If Len(t) > 0 Then | |
tOut = WorksheetFunction.Match(CStr(t), tArr, 0) | |
If WorksheetFunction.IsError(tOut) Then | |
out = False | |
Else | |
out = True | |
End If | |
End If | |
Next t | |
IsArrayUnique = out | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment