ANString_Location

Finds the location of a sting inside list of strings with certain separator, or as we call it ANString.
So, when you have ...
String1|String2|String55|String6| in InString2
Calling ANString_Location("String55", InString2, "|") will return 3

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ANString_Location(String1, InString2, Sepa)
    ' Finds location of String1 in String2 giving certain separator
    X1                            = 0
    Rett                        = X1
    If VBInstr(String1, InString2) > 0 Then
        For Each ANItem in Split(InString2, Sepa)
            X1                    = X1 + 1
            If Ucase(Trim(ANItem)) = UCase(Trim(String1)) Then
                Rett            = X1
                Exit For
            End If
        Next
    End If
    ANString_Location        = Rett
End Function

String1, InString2, Sepa

Views 297

Downloads 22

CodeID
DB ID