Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Formula to extract cell contents in front of manual line break

Posted on 2013-01-31
4
Medium Priority
?
417 Views
Last Modified: 2013-01-31
Dear Experts:

I got hundreds of cells in a column with manual line breaks (Alt + Enter). I wonder whether it is possible to extract the cell contents in front of the manual line breaks using VBA code or a formula.

I have attached a sample for your convenience.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

Formula-Extracting-Text-Before-M.xlsx
0
Comment
Question by:AndreasHermle
  • 3
4 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 38839389
=LEFT(B4,SEARCH(CHAR(10),B4)-1)

for example
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 38839419
Note that assumes there is always a line feed. Safer to use

=IFERROR(LEFT(B4,SEARCH(CHAR(10),B4)-1),B4)

:)
0
 

Author Closing Comment

by:AndreasHermle
ID: 38839479
Dear rorya:

I sure love this forum. Thank you very much for your swift and professional support.

Regards, Andreas
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 38839586
Andreas,

You are most welcome. It is always a pleasure to deal with you :)

Rory
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question