Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

array functions

Status
Not open for further replies.

djam

Technical User
Nov 15, 2002
223
CA
where would I find all the functions related to an array, i looked in the help, but there must be more then that? I'm looking for a function that checks if an array contains a specific element.

Maybe there isn't such a function and I have to write my own?
"so many events, so little time"
 
Here's the general idea. Tweak it to suit your needs.

Private Sub searcharray()
Code:
Dim myarray(3) As Variant
Dim i As Integer
myarray(0) = "Dog"
myarray(1) = "Cat"
myarray(2) = "Mouse"
For i = 0 To UBound(myarray) - 1
    If myarray(i) = "Mouse" Then
        Debug.Print myarray(i) & " " & i
    Else
        End If
Next i
End Sub
Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top