+ Reply to Thread
Results 1 to 4 of 4

Fix phone numbers containing an x

  1. #1
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Fix phone numbers containing an x

    So I have this spread sheet containing thousands of phone numbers but some of the phone numbers are in this format 9185556666x654 or 9185556666X6545 so would like to have a macro that can remove all the number after the X so the number would like this 9185556666 and can this macro work on selection since the phone numbers does not come in the same column all the time thanks for the help appreciated
    Last edited by martinez_pedro; 08-03-2011 at 08:53 AM.

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Fix phone numbers containing an x

    Hi,
    Please Login or Register  to view this content.
    Change the Range to suit. eg.
    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Fix phone numbers containing an x

    Hi martinez_pedro
    Try this
    Please Login or Register  to view this content.
    Place the code in a standard module and run from there. Let me know of issues.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Re: Fix phone numbers containing an x

    Hi. Beforehand thank you for your help I was able to use the second the only modification I had to do was an error handler on the second code but it work great thank you
    The reason I added a error handler was because if did not an x in the number than it failing by give an error
    Please Login or Register  to view this content.

+ 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