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

Returning IndexNumber of Array

cindy2
P: 35
I know this can''t be hard, but the examples of the Index of VB2005 are not clear to me. The google items I found weren't also very clear.

How can I make my array return the indexnumber of a certain value.

example:


Array(i) = 5

How can I get i for which Array(i) = 5 is true

Cindy
Sep 20 '07 #1
Share this Question
Share on Google+
1 Reply


kadghar
Expert 100+
P: 1,295
I know this can''t be hard, but the examples of the Index of VB2005 are not clear to me. The google items I found weren't also very clear.

How can I make my array return the indexnumber of a certain value.

example:


Array(i) = 5

How can I get i for which Array(i) = 5 is true

Cindy
I dont know if there's a function that does that, but i think a FOR or a FOR EACH will do:

For i = lbound(array) to ubound(array)
if array(i) = 5 then msgbox (i)
next
Sep 20 '07 #2

Post your reply

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