FoundinList

Finds a matching item of a number in list of numbers.
Returns 1 if found, 0 if not.
With custom separator, this might need to have some more work to enhance.

CodeFunctionName
What is this?

Public

Tested

Original Work
Function FoundinList(Number1, List_of_Numbers, Optional Sepa = ",")
    ' Checks if a number is found in list of numbers
    ' Returns 1 or 0
    '
    Rett = 0
    For Each Numm In Split(List_of_Numbers, Sepa)
        Numm = Val(Trim(Numm))
        If Number1 = Numm Then
            Rett = 1
            Exit For
        End If
    Next
ByeBye:
    FoundinList = Rett
End Function

Number1, List_of_Numbers, Optional Sepa = ","

Views 107

Downloads 77

CodeID
DB ID