+ Reply to Thread
Results 1 to 10 of 10

remove and separate

  1. #1
    Registered User
    Join Date
    02-16-2008
    Posts
    48

    remove and separate

    Hello all,

    I am copying sports scores from the internet and the scores come in as 89-78 in one cell. I want a macro where it will take the data extract the first number in the next cell in the same row and extracts the second number into the third cell please see attached excel sheet.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: remove and separate

    use the attached macro
    Attached Files Attached Files
    Last edited by abduljaleel.mca; 04-18-2013 at 01:26 PM.

  3. #3
    Registered User
    Join Date
    02-16-2008
    Posts
    48

    Re: remove and separate

    Abduljaleel.mca

    Could you edit the macro so that it goes straight across? When I typed want 1st number here, i meant starting at the top, not where i put the text.

    Sorry for the confusion.

    Thanks.

  4. #4
    Registered User
    Join Date
    02-16-2008
    Posts
    48

    Re: remove and separate

    Anyone can help. Thanx.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: remove and separate

    Hello chemmiah,

    You can formulas to separate the data into the cells and drag the formulas down.

    Cell E1:
    =LEFT($D1,SEARCH("-",$D1,1)-1)
    Cell F1:
    =RIGHT($D1,LEN($D1)-SEARCH("-",$D1,1))
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: remove and separate

    No macro/formula

    [Data] - [Text to Columns]

  7. #7
    Registered User
    Join Date
    02-16-2008
    Posts
    48

    Re: remove and separate

    This works except it returns it as text and not a number. I want to take the numbers and use them in subsequent equations and i get errors because it treats the result as a text.

    The macro above returns it as a number but the problem is it returns it in the wrong spot.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: remove and separate

    Hello chemmiah,

    If you are referring back to the formulas, here is the update to return numbers and not text.

    Cell E1:
    =VALUE(LEFT($D1,SEARCH("-",$D1,1)-1))
    Cell F1:
    =VALUE(RIGHT($D1,LEN($D1)-SEARCH("-",$D1,1)))

  9. #9
    Registered User
    Join Date
    02-16-2008
    Posts
    48

    Re: remove and separate

    Thank you this totally worked.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: remove and separate

    Hello chemmiah,

    You're welcome.

+ 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