View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Fast record searching in array

Is the array sorted, in particular the dimension you want to look in. If so
a "binary search" will return your result almost instantly no matter what
the size of your array. It's worth keeping your array sorted just for for
this purpose.

A quick google should find plenty of examples for you.

Regards,
Peter T

"Christopher Panadol" wrote in message
...
Hi,

I know that there is the SEARCH command to find a record location quickly
in a range of cells. However I would like to know whether it has the same
command to find record location in array.

I have searched a lot of information in many VBA sites. They all suggest
to use a looping method like FOR....NEXT, DO....WHILE, etc to achieve
this. However, I found that if the quantity of array record is over
serveral thousand, using the looping method to locate the record is very
slow.

I know it is work by using the temorary sheet rather than array for such
case. I also test it and it found quite slower than using the array
method.

Is there a command or otherwise to have a fast searching in array?

Regards,
Chris