+ Reply to Thread
Results 1 to 8 of 8

Extract Data Between Carriage Returns

  1. #1
    Registered User
    Join Date
    09-08-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    25

    Extract Data Between Carriage Returns

    I have a cell that contains several carriage returns. How do I extract data from between 2 carriage returns?

    Thanks.
    Last edited by nycstinger; 09-10-2009 at 08:03 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Extract Data Between Carriage Returns

    A workbook with a few samples might help - with desired output.

    Perhaps in the interim something like:

    Please Login or Register  to view this content.
    Where A1 holds string ... or pending length of phrases between carriage returns another alternative might be:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Extract Data Between Carriage Returns

    I recorded this macro.

    Please Login or Register  to view this content.
    I had text in A1:A3 that had multiple carriage returns in each cell. The macro does a FIND REPLACE (CTRL+H) and replaces all carriage returns with a "/" - then does a TEXT to COLUMNS. I had to do the FIND REPLACE first, since you cant do a Text to Columns using a carriage return as a delimiter.

    Tweek it to your needs.

    Hope this helped,

    GWB
    Last edited by GuruWannaB; 09-09-2009 at 11:22 AM.
    I help because of the Pavlovian dog that resides in the inner me...so if you are happy with the results, please add to my reputation. It helps keep me motivated!



    Please mark your threads as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extract Data Between Carriage Returns

    I thought this was being answered here?:

    http://www.excelforum.com/excel-gene...reet-name.html
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    09-08-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Extract Data Between Carriage Returns

    Quote Originally Posted by NBVC View Post
    I thought this was being answered here?:

    http://www.excelforum.com/excel-gene...reet-name.html
    This question is from a different project and I didn't realize the similarities until I saw your reply.

  6. #6
    Registered User
    Join Date
    09-08-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Extract Data Between Carriage Returns

    I ended up using the following solution where G2 is the cell with the string:

    Please Login or Register  to view this content.
    It essentially says the following:
    (1) If the cell has 2 carriage returns then (2) find the space number of the second one by substituting a "-" for the returns, (3) find the space number of the first one and (4) return what's between them.

  7. #7
    Registered User
    Join Date
    12-30-2013
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Extract Data Between Carriage Returns

    I have a similar issue to nyc stinger - I have numerous cells with data seperated by carraige returns, and would like to seperate each line of text into a cell of its own. A formula would definitely be preferred over code!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Extract Data Between Carriage Returns

    megnicd,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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