+ Reply to Thread
Results 1 to 2 of 2

Find and Replace, Formatting, Formatting Formula

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    Kerala, India
    MS-Off Ver
    Excel 2013
    Posts
    93

    Post Find and Replace, Formatting, Formatting Formula

    Hi! Am using MS Office 2007,

    I have a list of Names followed by the City and State, I need to separate the the Names, City and States

    Eg:

    Mr.Thomas B Fernan dez New York.NY
    Mr.Bar ry K Olivia Houston.TX
    Ms.Dor othy D Hawell Rocky Mount.NC
    Mr.Tho mas L Morg Deerpark.NY
    M rs.Jennifer D Lebl anca Carlisle.PA


    Expected Result:<tab> represents next column

    Mr.Thomas B Fernandez <tab>New York.NY
    Mr.Barry K Olivia <tab>Houston.TX
    Ms.Dorothy D Hawell <tab>Rocky Mount.NC
    Mr.Thomas L Morg <tab>Deerpark.NY
    Mrs.Jennifer D Leblanca <tab>Carlisle.PA

    Suggestions:

    1. Take off all <SPACE> continued by small letters (Fernan dez - Fernandez; Bar ry - Barry; Dor othy - Dorothy; M rs. - Mrs.; Lebl anca - Leblanca, so on......)

    2. Names always have the same format. i.e.: SALUTATION.<FIRSTNAME>SPACE<Initial of MIDDLE NAME>SPACE<LAST NAME>

    3. Place a <TAB> before the 5th Capital Letter, i.e. before city 'New York' in first case.

    which can give the above mentioned result.

    Its really urgent for me! Please help me out!

    Thank you in advance! your early reply is highly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Find and Replace, Formatting, Formatting Formula

    This one is very similar to your second problem in your other post and we solve it in a similar way.

    First remove all the Spaces in the string
    Then use your macro to insert a space before each capital letter.
    That should give you:
    Please Login or Register  to view this content.
    Next we need to replace the 4th instance of a Space character, so in B1 enter the formula:

    =SUBSTITUTE(A1," ","|",4)

    This should give you:

    Please Login or Register  to view this content.
    You can now use Text to Columns and split up the cell into it's separate parts using the pipe symbol.

    A couple of problem, you will probably have, is a name with NO middle initial or a name not capitalized.
    That will mess up the number of spaces in the string.
    You may need to tweek the formula a bit.

+ 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. Replies: 4
    Last Post: 05-07-2014, 03:40 PM
  2. [SOLVED] Unable to maintain formatting on find/replace
    By samwise78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2012, 05:50 PM
  3. Replies: 1
    Last Post: 06-19-2011, 02:57 AM
  4. Find & Replace Stripping Formatting
    By Jbm444 in forum Excel General
    Replies: 3
    Last Post: 08-05-2010, 03:58 AM
  5. Find/Replace w/ Conditional Formatting?
    By bludovico in forum Excel General
    Replies: 1
    Last Post: 04-29-2005, 10:13 AM

Tags for this Thread

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