Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is a value in an array
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Code:
Function ArrayFind(arrToSearch,strToFind)
        Dim aIter
        For aIter=0 To UBound(arrToSearch)
            If Replace(Trim(arrToSearch(aIter)), chr(32), chr(160))=Replace( Trim(strToFind), chr(32), chr(160)) Then
                ArrayFind=aIter+1
                Exit Function
            End If
        Next
        ArrayFind=-1
    End Function

If ArrayFind(TestArray ,DataTable("GotValue", dtGlobalSheet)) <> -1 'help me' Then
...This code will execute if "GotValue" is in the TestArray
End If
Reply


Messages In This Thread
Is a value in an array - by Brian.Osborne - 02-17-2011, 08:27 PM
RE: Is a value in an array - by surya_7mar - 02-17-2011, 09:28 PM
RE: Is a value in an array - by tarun - 02-17-2011, 09:41 PM
RE: Is a value in an array - by basanth27 - 02-23-2011, 07:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to convert a single dimension array to two dimensional array venkatesh9032 3 5,518 02-10-2014, 03:07 PM
Last Post: pranikgarg
  Adding array to another Global array in VB Script test911 1 3,166 12-02-2012, 12:40 PM
Last Post: parminderdhiman84

Forum Jump:


Users browsing this thread: 1 Guest(s)