By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,646 Members | 2,098 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,646 IT Pros & Developers. It's quick & easy.

Searching a two dimensional array

P: 9
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
Share this Question
Share on Google+
1 Reply


P: 13
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.