Vlookup using array ?

C

Charles

Hi,

Once again I need help.
I'm trying to use Vlookup in my vba code, but receive an error.
The following is in a worksheet called Data
Emily 150 IA-1 <435 Likely Too Thin n/a
Emily 150 IA-1 435 - 477 Leave Epi 250
Emily 150 IA-1 478 - 528 Remove Epi 250
Emily 150 IA-1 529 - 573 Leave Epi 300
Emily 150 IA-1 574 - 617 Remove Epi 300
Emily 150 IA-1 618 - 672 Leave Epi 350
Emily 150 IA-1 673 - 727 Remove Epi 350
Emily 150 IA-1 >727 Likely Too Thick n/a

You will see a number range 436-477 this is in column D of my work
sheet.
I'm using a userform and in a text box I enter a value of "466" in
another textbox I will be looking for
the values of 435-477.
As you can see the value of 466 is a value between 435-477.
I used the worksheet function for Vlookup, and it errors. So I assume
it has the do with the values in column D.

Any help would be appreciated.
 
P

Pete_UK

You don't need to put the range 435-477 in column D - just put the
lower value of the range, i.e. 435, then 478 in the next cell, 529 in
the next etc. Put zero in the first cell and 728 in the last cell,
then your vlookup should work (as long as you have TRUE or 1, or
omitted for the 4th parameter).

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top