LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Best/Easiest way to search/find in a string

If InStr(1, Source, "input_range", vbTextCompare) Then

You have to consider if the CASE makes a difference in you text. You may
want to force all text to uppercase before you do a comparison. Instr is
case sensitive, while using "=" is not case sensitive.


InStr has optional arguments... if you specify the optional starting point
for your search in the 1st argument, then an optional 4th argument is
available to take care of casing issues. In my statement above,
vbTextCompare forces a case insensitive search to take place (you can
specify vbBinaryCompare which forces an case sensitive search to take place,
but specifying it is unnecessary as it is the default condition for searches
when not specified).

Rick

 
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
Find specific info using search string using VBA laavista Excel Discussion (Misc queries) 5 May 20th 09 07:59 PM
Easiest way to find differences between Rows? Jonathan Excel Discussion (Misc queries) 3 February 20th 09 08:51 PM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
FIND / SEARCH text compare cell to string in 3rd cell nastech Excel Discussion (Misc queries) 0 October 29th 07 02:51 AM
search a string withing a string : find / search hangs itarnak[_9_] Excel Programming 4 October 24th 05 03:19 PM


All times are GMT +1. The time now is 05:34 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"