+ Reply to Thread
Results 1 to 4 of 4

Compare the strings

  1. #1
    Registered User
    Join Date
    09-01-2005
    Posts
    10

    Red face 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

  2. #2
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by yangyh
    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
    Houston, TX

  3. #3
    Registered User
    Join Date
    09-01-2005
    Posts
    10

    No Search function in VBA

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

    David

  4. #4
    Juan Pablo González
    Guest

    Re: Compare the strings

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1