+ Reply to Thread
Results 1 to 8 of 8

Finding Proper Names in a Cell of Text

  1. #1
    Registered User
    Join Date
    03-04-2013
    Location
    Lansing, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    4

    Finding Proper Names in a Cell of Text

    I’m looking for a way to find a proper name within a cell of text. I have a scrape from a webcrawl that contains the body of websites and often times the metadata for author isn’t actually the person who authored the article. What I think might work is, using VBA in excel, if I could find any occurrences of two, three or four words in a row that start with a capital letter. Once they have been found they would be put in the adjacent cell.

    Example:

    Column A ------------------------------------------Column B
    This would be the text. Alan Smith. Blah blah.--------Alan Smith
    More text. Blah blah. Dr. T. G. Gordon.----------------Dr. T. G. Gordon

    Any Ideas?

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Finding Proper Names in a Cell of Text

    Only a single proper name?
    Gary's Student

  3. #3
    Registered User
    Join Date
    03-04-2013
    Location
    Lansing, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Finding Proper Names in a Cell of Text

    Preferably any proper name in case the article is referencing another person. So multiple proper names if they're there.

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Finding Proper Names in a Cell of Text

    Install the following User Defined Function (UDF)

    Please Login or Register  to view this content.
    Thus if A1 contains:

    This is the time that James William Smith arrived from New York.

    and B1 contains:

    =FullName(A1)

    it would display:

    James William Smith


    NOTE:

    Only gets the first name it finds (ignores New York)

  5. #5
    Registered User
    Join Date
    03-04-2013
    Location
    Lansing, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Finding Proper Names in a Cell of Text

    This looks great! Would there be an easy fix so it would also display New York as well as James William Smith?

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Finding Proper Names in a Cell of Text

    I will take a look.

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Finding Proper Names in a Cell of Text

    Sorry Jakobshavn

    I was intrigued my your code and modified it in an attempt to understand it.

    The following is not as neat as your code but it works for multiple names.

    Enjoy.



    Please Login or Register  to view this content.

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Finding Proper Names in a Cell of Text

    Hi mehmetcik:

    Very Nice!

    Multiple name are retrieved!

+ 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