Lookup error in code

Closed
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - Mar 11, 2011 at 04:47 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 11, 2011 at 05:35 AM
Hello,

Hi i am using this code for lookup

dim b , n as long
b = Cells(2,1 ).Value
n =LOOKUP(b,{25000,50000,100000;1,2,3})


it doesnot give me result, what is the right syntax for lookup.

Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 11, 2011 at 05:35 AM
there are two ways to use lookup

LOOKUP(lookup_value,lookup_vector,result_vector)

and

LOOKUP(lookup_value,array)
0