+ Reply to Thread
Results 1 to 3 of 3

Extract a country name from the different String

  1. #1
    Registered User
    Join Date
    10-07-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    1

    Smile Extract a country name from the different String

    Hi,

    I have Different strings with the country name in it and I need to extract the name of country from it:
    1) Diamonds deposited in Kenya
    2) India's gold rich is deposit
    3) Natural gas deposits in Saudi

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Extract a country name from the different String

    The only way i can see you doing this is having a range of all the countries and then looping through that range and checking if the string contains one of those country names.
    That could be a very lengthy loop depending on how many countries and string to check.

    Cant really help more without more data or an example workbook.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Extract a country name from the different String

    Hi amriali,

    welcome to the forum.
    I observed that the country names are either at beginning or at the end.. is this the case with your entire data.. confirm back so that I can provide you a formula solution. Thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

+ 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