View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default How do I make a Binary Search Algorithm on Excel?

The simplest way is to use the Excel MATCH or VLOOKUP functions with
the sorted option, they already use Binary Search.

If you want to do it from VBA then use something like

vRow=application.WorksheetFunction.Match(ValuetoFi nd,RangetoSearch,1)

If for some reason you want to program it yourself in VB then I would
Google for Binary Search VB6 or VBA

regards
Charles

On Wed, 10 Mar 2010 09:26:01 -0800, NewToVB
wrote:

Basically I have to search a data set via customer codes using a binary
search algorithm and have no idea how to do it? I'm very new to VB so would
appreciate some simple words :)