ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   text/number formating question (https://www.excelbanter.com/excel-programming/432006-text-number-formating-question.html)

John[_19_]

text/number formating question
 
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


All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com