Can I use HLookup with an internally defined array?

  • Thread starter Thread starter plh
  • Start date Start date
P

plh

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
 
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 Site
http://www.decisionmodels.com
 
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

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