+ Reply to Thread
Results 1 to 3 of 3

how to only display first line of each cell

  1. #1
    Registered User
    Join Date
    08-04-2017
    Location
    Nürtingen, Germany
    MS-Off Ver
    365
    Posts
    4

    Angry how to only display first line of each cell

    I posted this here in gerneral because it might be VBA or Excel Function..
    I have a problem with a table, consisting of one column with data. The data is like
    _______________________________________________
    Product1 Information1 (next line) Information2 (next line)
    __________________________________________________
    Product 2
    ___________________________________________________
    Product 3 Informrmation1 (next line) Information2 (next line) Information3 (next line)
    ________________________________________________________________________
    As you can see there are a different number of informationlines in each cell. All I want is the same table, but only with the first line of each Cell.... I tried a combination of the a LEFT and FIND function but the result was not good enaugh.
    The table is created with a VBA code using the advanced filter option on another table in a different worksheet.
    Please Login or Register  to view this content.
    If I use formulas like =LEFT(A9;FIND(CHAR(10);A9)-1) there will of course be an error on cells with only 1 line....
    I'd love an idea on how to get my problem solved and every help is very appreciated
    PS: I'd prefer a method I can include in the creation of the table (the code displayed above) if thats possible. If someone has other methods to get this over with Ill also be happy to use them.
    Kind regards
    hellownero
    Last edited by hellownero; 08-04-2017 at 07:29 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: how to only display first line of each cell

    This should work

    =IF(ISNUMBER(SEARCH(CHAR(10),A1)),LEFT(A1,FIND(CHAR(10),A1)-1),A1)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    08-04-2017
    Location
    Nürtingen, Germany
    MS-Off Ver
    365
    Posts
    4

    Re: how to only display first line of each cell

    antwort1.PNG

    antwort2.PNG

    This happens... what did I do wrong? The cell will just go blank:/
    My Excel is in German so I translated the formula. It should be correct I guess.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 05-20-2020, 02:23 PM
  2. Iu-line Display of Text in a Cell
    By trav1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-23-2017, 08:56 AM
  3. Replies: 6
    Last Post: 03-03-2016, 10:02 PM
  4. [SOLVED] Display vertical line on stacked line chart already using primary and secondary axises
    By ben_hensel in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-05-2012, 10:21 AM
  5. [SOLVED] How to display the arrays with line spcae in between, within a cell?
    By Rahul888 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2012, 11:19 AM
  6. Force a selected cell/range to display directly under the freeze line
    By batman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2008, 01:12 PM
  7. DISPLAY ZERO WITH LINE THROUGH IT
    By DISPLAY ZERO WITH LINE THROUGH IT in forum Excel General
    Replies: 5
    Last Post: 10-07-2005, 08:05 PM

Tags for this Thread

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