ANmaSearch_AmpFriends

Searches for string inside string with multiple possibilities
if the char & was not found in SearchFor
    '    it will try searching with all possible forms of it in HTML codes
    '    like        &    &

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ANmaSearch_AmpFriends(SearchFor, SearchIn, Optional StartSearchFrom = 1)
    ' Searches for string inside string with multiple possiblities
    ' if & quote was found in SearchFor
    '    it will try searching with all possible translation of it in HTML codes
    '    like        &    &
    '
    ' Needs VBInstr
    Rett = 0
    If StartSearchFrom = 0 Then StartSearchFrom = 1
    Rett = VBInstr(SearchFor, SearchIn, StartSearchFrom)
    If Rett > 0 Then GoTo ByeBye
    If VBInstr("&", SearchFor) > 0 Then
        ' Searching for single quote uses replace
        Rett = VBInstr(Replace(SearchFor, "&", "&"), SearchIn, StartSearchFrom)
        If Rett > 0 Then GoTo ByeBye
        Rett = VBInstr(Replace(SearchFor, "&", "&"), SearchIn, StartSearchFrom)
        If Rett > 0 Then GoTo ByeBye
       
    End If
ByeBye:
    ANmaSearch_AmpFriends = Rett
End Function

SearchFor, SearchIn, Optional StartSearchFrom = 1

Views 60

Downloads 12

CodeID
DB ID