Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Search an array

Assume an array of string type, and a string varible. Is
there a function or shortcut way of identifying the index
number of the first element whose value matches the value
of the variable?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Search an array

One way is Excel's Match function:

Application.Match(lookup_val, arr(), 0)

returns either the index position of the value found in the list, or an
error if not found, so use a variant and trap the error using IsError.


" wrote in message
...
Assume an array of string type, and a string varible. Is
there a function or shortcut way of identifying the index
number of the first element whose value matches the value
of the variable?



  #3   Report Post  
Posted to microsoft.public.excel.programming
art art is offline
external usenet poster
 
Posts: 2
Default Tim - perfect - thanks (eom)


-----Original Message-----
One way is Excel's Match function:

Application.Match(lookup_val, arr(), 0)

returns either the index position of the value found in

the list, or an
error if not found, so use a variant and trap the error

using IsError.


"

wrote in message
...
Assume an array of string type, and a string varible. Is
there a function or shortcut way of identifying the

index
number of the first element whose value matches the

value
of the variable?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Search an array

Application.Match is 1-based, so you will need to adjust for 0-based
arrays (or, for that matter, for an n-based array where n is not 1).

Alan Beban

Tim Zych wrote:
One way is Excel's Match function:

Application.Match(lookup_val, arr(), 0)

returns either the index position of the value found in the list, or an
error if not found, so use a variant and trap the error using IsError.


" wrote in message
...

Assume an array of string type, and a string varible. Is
there a function or shortcut way of identifying the index
number of the first element whose value matches the value
of the variable?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I search for the second largest value in the array? Golf Excel Worksheet Functions 2 April 22nd 10 09:33 AM
array search Luke Excel Worksheet Functions 8 February 2nd 09 08:25 AM
Please help on array search & result ORLANDO V[_2_] Excel Worksheet Functions 3 January 29th 08 11:34 PM
search array jchick0909 Excel Worksheet Functions 3 October 5th 07 07:25 PM
Text Search in an Array Jay Excel Worksheet Functions 1 September 12th 06 11:37 PM


All times are GMT +1. The time now is 10:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"