I was previously dynamically building a 1D array by looping down a column in a spreadsheet. Because I only wanted unique values in this array, I'm calling
Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean.
IsInArray = (UBound(Filter(arr, stringToBeFound)) > -1)
End Function
on each element before adding it. So far, so good.
Now I need to have elements from 2 columns stored, so I need to expand this to a 2D array. I only need the original data element to be unique, but my original function will not accept a 2D array.
Is there a way to search just one "column" of a 2D array to see if a string exists?
I've thought of a few workarounds, including concatenating both values and keeping them in a 1D array, then parsing them out, etc, but I'd like to know if the "find if one element is unique" approach is possible.