+ Reply to Thread
Results 1 to 10 of 10

Macro to format phone number

  1. #1
    Registered User
    Join Date
    02-26-2016
    Location
    Monsey NY
    MS-Off Ver
    2012
    Posts
    15

    Macro to format phone number

    I have a phone hotline where the called in phone numbers are emailed to me in the following format 999-999-9999. However when I do a live teleconference the phone numbers that are emailed to me are formated like so: (999)999-9999 - JANE DOE. I paste both sets of phone numbers into excel to get rid of the duplicates. I want to change the live teleconference format (delete the name and take away the parenthesis) to reflect the hotline format. Is there a simple way to do this either by find & replace or by creating a macro? Thanx

  2. #2
    Forum Contributor
    Join Date
    04-19-2015
    Location
    pakistan
    MS-Off Ver
    2013
    Posts
    335

    Re: Macro to format phone number

    Hi try this
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to format phone number

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Macro to format phone number

    The formula = TEXT(LEFT(SUBSITUTE(A1,"-",""),10)+0, "000-000-0000") should do the trick.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    02-26-2016
    Location
    Monsey NY
    MS-Off Ver
    2012
    Posts
    15

    Re: Macro to format phone number

    I used Mr. Davis's formula and the numbers that were in 999-999-9999 were left alone as expected, the numbers with the () were formatted without the name as expected however they were formatted 999-X999-999 with "X" being a space.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to format phone number

    I wasn't aware there could be spaces within the phone numbers. Try:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-26-2016
    Location
    Monsey NY
    MS-Off Ver
    2012
    Posts
    15

    Re: Macro to format phone number

    I tried it with the same results. This was my mistake. I also didn't realize there was a space. The format is (999) 999-9999 not (999)999-9999.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to format phone number

    Perhaps:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-26-2016
    Location
    Monsey NY
    MS-Off Ver
    2012
    Posts
    15

    Re: Macro to format phone number

    Worked like a charm.

    Thanx tons!

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to format phone number

    You're welcome. Glad to help out and thanks for the feedback. Please review the Forum Rules and mark this thread as SOLVED.

+ 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. [SOLVED] Phone number format - reference post (Formatting Textbox to type phone numbers only)
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2015, 05:35 PM
  2. [SOLVED] Extract Following Format Phone Number
    By Mohanmoni in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-20-2015, 12:47 PM
  3. Phone number format in vba text box?
    By aduma in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-04-2015, 12:32 AM
  4. Change Phone number format
    By genefalk1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-26-2014, 10:43 PM
  5. Format a Phone Number
    By scotfitz in forum Excel General
    Replies: 4
    Last Post: 12-23-2009, 07:01 PM
  6. Format change of phone number
    By helpjim in forum Excel General
    Replies: 7
    Last Post: 05-18-2006, 02:34 PM
  7. how do I add phone number format as a permanent custom format?
    By frustratedagain in forum Excel General
    Replies: 3
    Last Post: 02-03-2006, 11:52 PM

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