text/number formating question

J

John

Everything on the sheet is formatted as text but all the text is
numbers. Treat everything as strings in the code.

Problem:

Looking for the string "29" in the range Buddies. A=29 where A is a
string variable. All of the range Buddies is formated as text although
it is all numbers.

Set Third = Buddies.Find(what:=A, lookat:=xlWhole) Doesn't find string A
Set Third = Buddies.Find(what:=Val(A), lookat:=xlWhole) DOES find string A

Why is this? I'm looking for a string "29" in a range of strings but can
only find it if I look for a value. It's confusing.



John
 

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