+ Reply to Thread
Results 1 to 5 of 5

Excel Macro that will convert phone #s

  1. #1
    Registered User
    Join Date
    03-27-2009
    Location
    Kansas City, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Excel Macro that will convert phone #s

    I'm needing a macro that will convert a column of 10 digit phone numbers and break them out or convert them from a XXXXXXXXXX format to a XXX XXX XXXX format.

    I want to be able to copy and paste a long column of 10 digit numbers then have the macro run down the column and cut or copy the area code (first 3 digits of the 10 digit string) - move it two columns to the left - paste it into that cell - return then cut the next 3 digits - move it one column to the left, and paste it.

    Much thanks in advance!

    Workbook >

    http://www.mediafire.com/?sharekey=e...4e75f6e8ebb871
    Last edited by rylo; 03-28-2009 at 07:58 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Need an Excel Macro that will convert phone #s

    Hi

    Try this.
    Please Login or Register  to view this content.
    rylo

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Need an Excel Macro that will convert phone #s

    You may not need a macro...

    Using your posted workbook
    • Select from F6 down through the last 10-digit phone number

    From the Excel Main Menu:
    <data><text-to-columns>
    • Check: Fixed width...Click: Next

    Insert break points:
    • Click between the 3rd and 4th digits from the left
    • Click between the 6th and 7th digits from the left
    • Click: Next

    • Destination: (select cell D6)
    • Click: Finish
    (When prompted to replace the contents of destination cells...Click: OK)
    • Done!

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    03-27-2009
    Location
    Kansas City, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Need an Excel Macro that will convert phone #s

    Solved, thanks!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need an Excel Macro that will convert phone #s

    Why not just format as phone numbers?

    Format > Cells > Number, Special, Phone Number
    Entia non sunt multiplicanda sine necessitate

+ 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