Scott
Glad the initial thing worked for you.. It is the key.
I the Select solution I gave had a bug when I typed it in
(should have copy/pasted it)
The following does work and is a c/paste.
Do
lngMiddle = (lngFirst + lngLast) \ 2
Select Case StrComp(strArray(lngMiddle), strSearch)
Case 0
BinarySearch = lngMiddle
Exit Do
Case Is < 1
lngFirst = lngMiddle + 1
Case Is > 1
lngLast = lngMiddle - 1
End If
Loop Until lngFirst > lngLast
David
[Non-text portions of this message have been removed]
__._,_.___
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
MARKETPLACE
.
__,_._,___
Tidak ada komentar:
Posting Komentar