+ Reply to Thread
Results 1 to 4 of 4

Fixing Surnames with O/ Mc etc.

  1. #1
    Registered User
    Join Date
    01-08-2015
    Location
    Ireland
    MS-Off Ver
    365
    Posts
    1

    Fixing Surnames with O/ Mc etc.

    Hi everyone,

    I have a very long list of names extracted from email addresses (still in progress, may need another thread for some of this).

    However, a lot of the names have "O" and "Mc" in them.
    At the moment this comes out as "Obrien" when I need it to be "O'Brien" and "Mckenna" when I need it to be "McKenna".

    Is there any shortcut I can devise for doing this? I know I would need separate ones for "O"s and "Mc", and would still have to go threw all the names manually to see where it needed to be applied, but it would still save a lot of time.
    Basically I'd like to be able to press keyboard shortcuts or run a Macro every time I come across a cell that needs this treatment, rather than having to select right part of the text every time, delete the lower case letter, replace with upper case and add the apostrophe.

    I really hope someone can help!

    Thanks

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Fixing Surnames with O/ Mc etc.

    Hi Loughgill,

    Welcome to the Forum!

    How would you handle Machinery??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Fixing Surnames with O/ Mc etc.

    I think you're correct in thinking you'd still have to check manually, add the following Sub to a module:

    Please Login or Register  to view this content.
    then go into Developer, go to Macros>highlight the McFix macro and select Options

    Add a shortcut keystroke (I did Ctrl-Alt-M).

    et voila, click a cell that contains the name, pres the shortcut keys and the names fixed.
    If someone has helped you then please add to their Reputation

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Fixing Surnames with O/ Mc etc.

    Quote Originally Posted by xladept View Post
    Hi Loughgill,

    Welcome to the Forum!

    How would you handle Machinery??
    or something like Obama?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Fixing Formulas
    By hami812 in forum Excel General
    Replies: 2
    Last Post: 12-08-2011, 01:41 PM
  2. Seperate First and Surnames
    By SpAnKy in forum Excel General
    Replies: 3
    Last Post: 06-20-2008, 12:33 PM
  3. I'm Trying To Isolate Capitalised Surnames From a String
    By Gordon@work in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2007, 02:35 AM
  4. [SOLVED] splitting first and surnames
    By mattguerilla in forum Excel General
    Replies: 2
    Last Post: 04-05-2006, 07:35 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