Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Return Exact Value

It sounds like you have a data problem. there may be spaces or other
invisible characters in the cell with your numbers. Using Instr will avoid
that problem, but causes the problem you originally posted about. If any
stray characters are only the right side of your number, you can try

If InStr(1, Trim(.Value), Trim(MyCriteria),vbTextCompare) = 1 Then

rather than

If InStr(1, .Value, MyCriteria) 0 Then

--
Regards,
Tom Ogilvy


"Dean" wrote in message
oups.com...
Thanks Tom for the reply.

I tried the suggested change but the code will not return any search
results.

The department numbers in column A are randomly scattered
EG:

column A
1
5
9
17
13
9
8
15
etc etc....



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need formula to return exact match gootroots Excel Worksheet Functions 8 November 18th 09 10:14 PM
Vlookup - return exact phrase duketter Excel Discussion (Misc queries) 4 July 7th 09 05:13 PM
Need a function to return EXACT row number of a match [email protected] Excel Worksheet Functions 3 November 16th 08 04:05 AM
Font color of exact function return in excel should be customize Thakku Ramanan Excel Programming 1 December 22nd 05 06:49 AM
Macro to compare values and return exact matching value [email protected] Excel Programming 1 January 2nd 04 11:59 PM


All times are GMT +1. The time now is 04:08 PM.

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

About Us

"It's about Microsoft Excel"