#1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 27,285
Default Please Help

Dropping the clng alone won't do if your A1:A100 contains a mix of numbers
and text (where cells have real numbers stored as numbers).

If that is the case, see my suggestion.

--
Regards,
Tom Ogilvy


"Dave Peterson" wrote in message
...
CLng() converts the numeric string to real numbers.

If you drop that from your statement, you'll be looking for a text match:

ans = Application.Match(TextBox2.Text, Range("A1:A100"), 0)



Greg wrote:

How do I change this to lookup a word in the range i specified. It

works
with numbers but not letters

ans = Application.Match(CLng(TextBox2.Text), Range("A1:A100"), 0)

Thanks in advance

Greg


--

Dave Peterson



  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,758
Default Please Help

Yep.



Tom Ogilvy wrote:

Dropping the clng alone won't do if your A1:A100 contains a mix of numbers
and text (where cells have real numbers stored as numbers).

If that is the case, see my suggestion.

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
CLng() converts the numeric string to real numbers.

If you drop that from your statement, you'll be looking for a text match:

ans = Application.Match(TextBox2.Text, Range("A1:A100"), 0)



Greg wrote:

How do I change this to lookup a word in the range i specified. It

works
with numbers but not letters

ans = Application.Match(CLng(TextBox2.Text), Range("A1:A100"), 0)

Thanks in advance

Greg


--

Dave Peterson


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Please Help

I used the code on each textbox on the form I needed to look up so I used
the number one on tb1 and the other code on tb 2& 3. Thanks for both your
help.

It runs perfect.

Greg


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"