I have a cell that contains several carriage returns. How do I extract data from between 2 carriage returns?
Thanks.
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.
A workbook with a few samples might help - with desired output.
Perhaps in the interim something like:
Where A1 holds string ... or pending length of phrases between carriage returns another alternative might be:Please Login or Register to view this content.
Please Login or Register to view this content.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I recorded this macro.
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.Please Login or Register to view this content.
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.
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.
I ended up using the following solution where G2 is the cell with the string:
It essentially says the following:Please Login or Register to view this content.
(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.
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!
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]
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks