+ Reply to Thread
Results 1 to 12 of 12

Extract same number and name in a cell

  1. #1
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Extract same number and name in a cell

    Hi all,

    I have an issue when extracting same phone number and client name in a cell

    I want to remove the same phone number and client name that don't have phone number

    The result
    - Because ABCD is a client name but it doesn't have phone number, I remove the name
    - 0933710850 XYZW is the same information , so 0933710850 XYZW is removed
    - The first letter of every phone number (it can be 10 to 13 digits) should equal "0". If the two first letter is "84", it should be replaced by 0.

    For example 0933710850 is ok, 84933710850, "84" will be remove and replace by 0

    Actually, I write the code but it has error 1004 and I can not fix it
    Please Login or Register  to view this content.
    Thanks for reading and helping
    Attached Files Attached Files
    Last edited by dtaphuong; 04-22-2017 at 04:01 AM. Reason: Change the uploaded file

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Extract same number and name in a cell

    Is [B3] in this line
    Please Login or Register  to view this content.
    as cell on sheet1? If so, I think it should read
    Please Login or Register  to view this content.
    In the same line, should rear be rearr?
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Re: Extract same number and name in a cell

    Quote Originally Posted by gmr4evr1 View Post
    Is [B3] in this line
    Please Login or Register  to view this content.
    as cell on sheet1? If so, I think it should read
    Please Login or Register  to view this content.
    In the same line, should rear be rearr?
    I change Range ("B3") but it still the same error

    rear is rearr.

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Extract same number and name in a cell

    I'm not to familiar with arrays in code, but should
    Please Login or Register  to view this content.
    be
    Please Login or Register  to view this content.
    or something of that format?

    Edit* Looking back at your code, I think I am incorrect.
    Last edited by gmr4evr1; 04-16-2017 at 10:30 AM. Reason: Added edit

  5. #5
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Re: Extract same number and name in a cell

    it doesn't work. Can you help me do new code for my issue.

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Extract same number and name in a cell

    Someone else will have to step in and help out with this. I'm not familiar with arrays and such within code to know what to do here.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Extract same number and name in a cell

    dtaphuong

    If you upload a workbook with before/after, you will probably get more help.
    Normally we don't want to work with picture.

  8. #8
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Re: Extract same number and name in a cell

    Thanks jindon.

    I just upload the file. Thanks for your recommend

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Extract same number and name in a cell

    Delete first row showing "Before" and run the code.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Re: Extract same number and name in a cell

    Thanks Jindon,
    Your code is so wonderful, it is so fast.
    Sorry for my mistyping on the latest file. I just uploaded new file. The code just remove same numbers if a cell has a number and name. I want remove all the same number and just keep the only one

    Ex there are twothe same phone number "06503913922", the second number should be removed and keep the one "06503913922"
    test 2.png
    Last edited by dtaphuong; 04-22-2017 at 04:59 AM.

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Extract same number and name in a cell

    Can you just edit your last post and delete full quote of my post?
    The forum doesn't like it unless it is really needed.

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

  12. #12
    Registered User
    Join Date
    08-21-2015
    Location
    Ho Chi Minh
    MS-Off Ver
    Vietnam
    Posts
    40

    Re: Extract same number and name in a cell

    Thanks Jindon,

    Everything is Ok

+ 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. extract number from text and number cell
    By south in forum Excel General
    Replies: 15
    Last Post: 08-23-2014, 03:28 AM
  2. [SOLVED] Extract Number from cell
    By Nick.123 in forum Excel General
    Replies: 21
    Last Post: 08-21-2014, 07:06 AM
  3. Extract number from a cell
    By mars.manee in forum Excel General
    Replies: 1
    Last Post: 01-09-2013, 12:02 PM
  4. extract number to a different cell
    By aranechan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-07-2011, 12:54 PM
  5. How to extract the first number in a cell?
    By Billznik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2009, 12:31 AM
  6. Extract number in middle of cell
    By Jason Morin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  7. [SOLVED] Extract number in middle of cell
    By SCOOBYDOO in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 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