+ Reply to Thread
Results 1 to 5 of 5

Simple question, search for multiple strings

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    asd
    MS-Off Ver
    asd
    Posts
    2

    Exclamation Simple question, search for multiple strings

    Hi Guys!

    This macro works great for 1 case, but Im trying to make this macro work for sevral situations,
    (it checked if cell contains a special word, and replaces it with a full country name)

    Please Login or Register  to view this content.
    I would like it to work like this;

    Please Login or Register  to view this content.
    Anyone has any idea? This would help a lot!!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Simple question, search for multiple strings

    Hi, and welcome to the forum.

    That works for me out of the box. Can you clarify what error you get.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-14-2015
    Location
    asd
    MS-Off Ver
    asd
    Posts
    2

    Re: Simple question, search for multiple strings

    The problem is if im standing on a cell with text CA in it, it does not correct it. It only corrects the first case (BE)

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Simple question, search for multiple strings

    Quote Originally Posted by DavidSailor92 View Post
    The problem is if im standing on a cell with text CA in it, it does not correct it. It only corrects the first case (BE)
    Perhaps you'd better upload the actual workbook so that we can see in context. Are you sure you have "CA" and not perhaps " CA" or "CA " or "ca"?

  5. #5
    Forum Contributor S O's Avatar
    Join Date
    06-25-2015
    Location
    England
    MS-Off Ver
    Office 2010 + 2013 + 2016
    Posts
    103

    Re: Simple question, search for multiple strings

    Not sure why you're using "Like" for literal strings...

    Anyway, try this:

    Please Login or Register  to view this content.
    Alternatively, re-arrange your Select Case syntax like so:

    Please Login or Register  to view this content.
    Last edited by S O; 10-14-2015 at 09:32 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. excel formula to search Multiple strings in several columns and return strings
    By krratna123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2013, 11:20 AM
  2. Replies: 1
    Last Post: 08-13-2013, 08:32 AM
  3. Truncate text strings using LEFT and FIND/SEARCH for multiple search terms
    By ngdoherty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2013, 07:51 PM
  4. Replies: 5
    Last Post: 03-29-2012, 04:12 AM
  5. Simple VBA Question - Search List of Strings Straight from VBA?
    By Strife in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2011, 06:21 PM
  6. Search for multiple text strings
    By SueWithQuestion in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-10-2011, 09:48 AM
  7. Simple IF(SEARCH() Question
    By philhale in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2010, 11:30 AM
  8. Simple Search and Replace Question
    By Rebecca in forum Excel General
    Replies: 2
    Last Post: 04-03-2005, 11:07 AM

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