View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
WLMPilot WLMPilot is offline
external usenet poster
 
Posts: 470
Default Matching user input to number in range

That was my next question. How do I trap if value not found? I have a
couple of books I used to understand the FIND function. The user will input
a three digit number (as a string). I need to match cell content, which will
hold a three digit number formatted to text. I figure the WHAT, SEARCHORDER,
and SEARCHDIRECTION is all I need, but I do not know how to trap if value not
found.

Les

"JLGWhiz" wrote:

Hi Les, I agree with David that the Find method is probably the fastest.
You can set up a validation loop with a message box in case the data entered
by the user is not found, so that it will recycle to the input box for the
user to make correction to their original entry or to just go to the next
item. That will speed up the process, rather than have the procedure
terminate because there was no match.

"WLMPilot" wrote:

I have a userform used to input a supply order using item number. The stock
items are listed on worksheet("Items"). I do not want to use a combo or
listbox. I want the user to enter the item number and then have a macro
check the range (A3:A, using xldown to determine actual range) and see if the
item number entered is a valid number before advancing to quantity field.

I thought about reading the data into an array and looping each time to
check but figure there is a quicker and easier way.

Thank,
Les