Thread: Foolproof .find
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Foolproof .find

Could there be extra stuff (leading/trailing spaces) in the part number cell?

If there are, then xlwhole would be a problem.

(I'd still specify all the parms to the .find command, though.)

Maybe the problem is the value in the textbox???

If you just did edit|find (after selecting that column), and search for the same
thing that you would have typed into the textbox, does it work ok?

"Robin S." wrote:

Thanks for the reply, Dave.

The .find parameters I'm using are as follows:

.Find(What:=TextBox1, LookIn:=xlValues, Lookat:=xlWhole)

This works just fine with a test worksheet which I have manually
produced using the same numbers as are in the worksheet of part numbers
from our vendor (which will not work with .find). It also works on
another price list from another vendor.

The only strange thing about the disfunctional price list is that it is
formatted to be printed into a hardcopy. Meaning, there are certain
rows which are used as headings, useful when searching for numbers in a
paper book. For instace, the list for all the "sawzall blades" will
have a "Sawzall Blades" heading in the row preceeding the first listed
blade. Obviously I didn't choose this format.

An example of the worksheet:

Part no. Description Price
48-00-1033 Sawzall blade $25.00

=ISTEXT on the part number results in TRUE
=ISNUMBER results in FALSE

This is the case in both my own test worksheet (in which .find works)
and the original vendor price list (in which .find doesn't work).

I tried to right click on the worksheet tab and selecting "Move or
Copy..." to create a new worksheet, as well as manually selecting the
range I'm using and copying it into another sheet (which sometimes
works when a sheet is protected) and this doesn't allow the .find to
work either.

I was hoping there was a worksheet function (like =TEXT(A2,0) for
instace) or some other blanket solution that I could use in order to
ensure the product number will always work.

Thanks for any thoughts. I don't mind doing my own research but I've
run out of places to start.

Regards,

Robin


--

Dave Peterson