#1   Report Post  
yangyh
 
Posts: n/a
Default Compare the strings


I want to check if the string contains a particular word, say, string
"World" doesn't
have "ed". What the operator shall I use here? Thanks.

David


--
yangyh
------------------------------------------------------------------------
yangyh's Profile: http://www.excelforum.com/member.php...o&userid=26883
View this thread: http://www.excelforum.com/showthread...hreadid=465743

  #2   Report Post  
BenjieLop
 
Posts: n/a
Default


yangyh Wrote:
I want to check if the string contains a particular word, say, string
"World" doesn't
have "ed". What the operator shall I use here? Thanks.

David


Try this ...

=ISERROR(SEARCH(\"ED\",A1))

where A1 contains the string that you want to search.

Regards.


--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=465743

  #3   Report Post  
yangyh
 
Posts: n/a
Default


Thank you. I could not find the SEARCH function in VBA help.
Could you tell me the syntex? Thanks.

David


--
yangyh
------------------------------------------------------------------------
yangyh's Profile: http://www.excelforum.com/member.php...o&userid=26883
View this thread: http://www.excelforum.com/showthread...hreadid=465743

  #4   Report Post  
Juan Pablo González
 
Posts: n/a
Default

In VBA you can use the InStr function, like

If InStr(1, TheString, "World") 0 Then
MsgBox "The string exists in there"
End If

--
Regards,

Juan Pablo González
Excel MVP
"yangyh" wrote in
message ...

Thank you. I could not find the SEARCH function in VBA help.
Could you tell me the syntex? Thanks.

David


--
yangyh
------------------------------------------------------------------------
yangyh's Profile:
http://www.excelforum.com/member.php...o&userid=26883
View this thread: http://www.excelforum.com/showthread...hreadid=465743



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
How can I compare Excel files AUSSIE GRAHAM Excel Discussion (Misc queries) 1 July 6th 05 06:14 AM
How do I compare FORMULAS in two workbooks Doug Gault Excel Discussion (Misc queries) 2 May 6th 05 04:36 PM
How can I compare the contents of two Excel files? Igor Green Excel Discussion (Misc queries) 0 May 4th 05 12:58 PM
Is there a way to compare 2 spreadsheets with Excel? Dave Peterson Excel Discussion (Misc queries) 3 March 29th 05 12:36 AM
Compare cells/columns and highlight matching text strings luxbelle Excel Worksheet Functions 1 February 25th 05 06:34 PM


All times are GMT +1. The time now is 12:38 AM.

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"