Solved

Formula to extract cell contents in front of manual line break

Posted on 2013-01-31
4
374 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now