467,881 Members | 1,194 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,881 developers. It's quick & easy.

Searching a two dimensional array

Does anyone know how to search a two dimensional array. I know how to do a one dimenisonal array but not a two dimensional.

Thank you in advance for your advise
Nov 8 '06 #1
  • viewed: 2537
Share:
1 Reply
standard method is using two for-next-loops:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Sub Test()
  3.       Dim values(10, 20) As String
  4.       Dim i, j As Integer
  5.  
  6.       For i = 0 To 10
  7.          For j = 0 To 20
  8.             If values(i, j) = "Got you!" Then
  9.                MsgBox("found")
  10.             End If
  11.          Next
  12.       Next
  13.  
  14. End Sub
  15.  
Nov 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Ruben | last post: by
60 posts views Thread by Peter Olcott | last post: by
22 posts views Thread by spam.noam | last post: by
6 posts views Thread by fniles | last post: by
272 posts views Thread by Peter Olcott | last post: by
5 posts views Thread by nelly0 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.