View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
plh[_5_] plh[_5_] is offline
external usenet poster
 
Posts: 6
Default Can I use HLookup with an internally defined array?

On Nov 10, 9:42*am, "Charles Williams"
wrote:
Yes, something like that or using VLOOKUP should work (but its probably
slower than just searching the array with a loop, unless the array is
sorted)

Charles
___________________________________
The Excel Calculation Sitehttp://www.decisionmodels.com

"plh" wrote in message

...

That is, one that is not taken from the spreadsheet.
Before I start banging my head against the wall, I thought I would ask
the experts!
Something like:


Sub MySub
Dim HLookupArray as Variant
Dim n,m as Long
n = Something
m = SomethingElse
LookupVal = SomethingElseYet
HLookupArray = Array(n,m)


(In hear put code assigning values to the array nodes)


SlowWalker = Application.HLookup(LookupVal, HLookupArray, 4, False)


End Sub


Thank You,
-plh


Thank You! I would have thought it would be faster in general.
-plh